Skip to content

Commit 19bb625

Browse files
csweichelaledbf
authored andcommitted
[docker] Fix non-provenance build without images
1 parent 6a359d4 commit 19bb625

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

pkg/leeway/build.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1296,10 +1296,12 @@ func (p *Package) buildDocker(buildctx *buildContext, wd, result string) (res *p
12961296
ef := strings.TrimSuffix(result, ".gz")
12971297
res.PostBuild = dockerExportPostBuild(wd, ef)
12981298

1299-
res.PackageCommands = [][]string{
1300-
{"tar", "fr", ef, "./" + provenanceBundleFilename},
1301-
{"gzip", ef},
1299+
var pkgcmds [][]string
1300+
if p.C.W.Provenance.Enabled {
1301+
pkgcmds = append(pkgcmds, []string{"tar", "fr", ef, "./" + provenanceBundleFilename})
13021302
}
1303+
pkgcmds = append(pkgcmds, []string{"gzip", ef})
1304+
res.PackageCommands = pkgcmds
13031305
} else if len(cfg.Image) > 0 {
13041306
for _, img := range cfg.Image {
13051307
pkgCommands = append(pkgCommands, [][]string{

0 commit comments

Comments
 (0)