Skip to content

Commit 6a340c6

Browse files
authored
Enable pushing cache with --no-push (#3181)
Make sure we check --no-cache-push instead of --no-push when deciding whether to push cache or not.
1 parent 942fbe6 commit 6a340c6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: pkg/executor/push.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -398,8 +398,8 @@ func pushLayerToCache(opts *config.KanikoOptions, cacheKey string, tarPath strin
398398
return errors.Wrap(err, "appending layer onto empty image")
399399
}
400400
cacheOpts := *opts
401-
cacheOpts.TarPath = "" // tarPath doesn't make sense for Docker layers
402-
cacheOpts.NoPush = opts.NoPush // we don't want to push cached layers if no push is specified
401+
cacheOpts.TarPath = "" // tarPath doesn't make sense for Docker layers
402+
cacheOpts.NoPush = opts.NoPushCache // we do not want to push cache if --no-push-cache is set.
403403
cacheOpts.Destinations = []string{cache}
404404
cacheOpts.InsecureRegistries = opts.InsecureRegistries
405405
cacheOpts.SkipTLSVerifyRegistries = opts.SkipTLSVerifyRegistries

0 commit comments

Comments
 (0)