Skip to content

Commit

Permalink
Enable pushing cache with --no-push (#3181)
Browse files Browse the repository at this point in the history
Make sure we check --no-cache-push instead of --no-push when deciding whether to
push cache or not.
  • Loading branch information
leosunmo committed Jun 4, 2024
1 parent 942fbe6 commit 6a340c6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/executor/push.go
Original file line number Diff line number Diff line change
Expand Up @@ -398,8 +398,8 @@ func pushLayerToCache(opts *config.KanikoOptions, cacheKey string, tarPath strin
return errors.Wrap(err, "appending layer onto empty image")
}
cacheOpts := *opts
cacheOpts.TarPath = "" // tarPath doesn't make sense for Docker layers
cacheOpts.NoPush = opts.NoPush // we don't want to push cached layers if no push is specified
cacheOpts.TarPath = "" // tarPath doesn't make sense for Docker layers
cacheOpts.NoPush = opts.NoPushCache // we do not want to push cache if --no-push-cache is set.
cacheOpts.Destinations = []string{cache}
cacheOpts.InsecureRegistries = opts.InsecureRegistries
cacheOpts.SkipTLSVerifyRegistries = opts.SkipTLSVerifyRegistries
Expand Down

0 comments on commit 6a340c6

Please sign in to comment.