Commit 4ee4883
fix: respect Docker export mode in SBOM generation
SBOM generation was not checking the LEEWAY_DOCKER_EXPORT_TO_CACHE
environment variable, causing it to always use the Docker daemon path
even when SLSA was enabled and images were exported as OCI layout.
The issue: buildDocker() calls determineDockerExportMode() which checks
the environment variable and CLI flags, but writeSBOM() only checked
p.Config.ExportToCache (which is nil when not explicitly set in BUILD.yaml).
This fix makes writeSBOM() use the same precedence logic:
1. Package config (if explicitly set)
2. Environment variable (LEEWAY_DOCKER_EXPORT_TO_CACHE)
3. CLI flag (--docker-export-to-cache)
Additionally, for the Docker daemon path, explicitly configure syft to
use the 'docker' source provider to avoid ambiguity when the image tag
is a content hash.
Fixes the CI failure in gitpod-next PR #11869 where SLSA is enabled
via workflow but SBOM generation was trying to scan from Docker daemon
instead of the OCI layout.
Co-authored-by: Ona <[email protected]>1 parent 9a7c4df commit 4ee4883
1 file changed
+22
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
240 | 240 | | |
241 | 241 | | |
242 | 242 | | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
243 | 260 | | |
244 | | - | |
| 261 | + | |
245 | 262 | | |
246 | 263 | | |
247 | 264 | | |
| |||
266 | 283 | | |
267 | 284 | | |
268 | 285 | | |
269 | | - | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
270 | 290 | | |
271 | 291 | | |
272 | 292 | | |
| |||
0 commit comments