Commit 76988bb
committed
fix: return early in DiscoverRunner to avoid unnecessary env checks
Stop iterating through all runner factories after the first matching
runner is found. Previously, DiscoverRunner would check every registered
runner (GitHub, GitLab, Azure, Jenkins, CircleCI, Dagger, TeamCity,
Tekton) even after finding a match. Some runners perform expensive
operations in CheckEnv() — opening k8s config files (Tekton) or making
API calls (GitHub) — making attestation init slower as more runners are
added.
Fixes #28341 parent 7b0148e commit 76988bb
1 file changed
Lines changed: 7 additions & 23 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
117 | | - | |
118 | | - | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
119 | 120 | | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
| 121 | + | |
124 | 122 | | |
125 | 123 | | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
| 124 | + | |
| 125 | + | |
139 | 126 | | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | 127 | | |
144 | 128 | | |
145 | | - | |
| 129 | + | |
146 | 130 | | |
147 | 131 | | |
148 | 132 | | |
| |||
0 commit comments