Repository navigation
Commit bb33898
fix: resolve the image scanner source instead of assuming a registry (#35)
Builder.SBOM hardcoded sbom.SourceRegistry, so an image the CLI built with
--load and never pushed failed resolution: `docker buildx imagetools inspect`
reports "pull access denied" for an image sitting in the local daemon, fully
scannable. Neither SBOMRequest nor ImageSubject carries a scanner source, so
the agent has to resolve it. The registry is tried first, so a stale local copy
cannot shadow what was actually published, and the daemon answers only for a
reference the registry cannot serve; when neither resolves, both causes are
reported rather than just the registry's.
The end-to-end test hid this. It called core's SBOMImages helper directly with
SourceDockerDaemon, bypassing Builder.SBOM and using the opposite source, so no
test ever drove the shipped method to a complete response and the shipped
configuration had never produced a successful scan anywhere. It now goes
through Builder.SBOM, and was confirmed to fail with the original "pull access
denied" when the fallback is removed.
A failed `uv lock` or `docker build` in that test called t.Skipf, so a broken
Dockerfile template would have skipped to a green run rather than failing the
job the test exists to protect. Both are t.Fatalf now; the tooling guard above
them has already established that the tools are installed.
Adds a source-scope routing test, which nothing covered: an inverted scope
comparison would have answered every source request with image evidence.
Reverts the testdata/recipe* gitignore entry as unrelated to this change.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>1 parent fe453a6 commit bb33898
3 files changed
Lines changed: 75 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
12 | 11 | | |
13 | 12 | | |
14 | 13 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
204 | 205 | | |
205 | 206 | | |
206 | 207 | | |
207 | | - | |
208 | | - | |
209 | | - | |
| 208 | + | |
210 | 209 | | |
211 | 210 | | |
212 | 211 | | |
213 | 212 | | |
214 | 213 | | |
215 | 214 | | |
216 | | - | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
217 | 250 | | |
218 | 251 | | |
219 | 252 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
61 | 86 | | |
62 | 87 | | |
63 | 88 | | |
| |||
169 | 194 | | |
170 | 195 | | |
171 | 196 | | |
172 | | - | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
173 | 200 | | |
174 | 201 | | |
175 | 202 | | |
| |||
179 | 206 | | |
180 | 207 | | |
181 | 208 | | |
182 | | - | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
183 | 213 | | |
184 | 214 | | |
185 | 215 | | |
186 | 216 | | |
187 | 217 | | |
188 | 218 | | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
189 | 224 | | |
190 | 225 | | |
191 | 226 | | |
192 | 227 | | |
193 | 228 | | |
194 | | - | |
| 229 | + | |
195 | 230 | | |
196 | 231 | | |
197 | 232 | | |
| |||
0 commit comments