From 21dc0ea7a71a12c66f56d553becbfadf4a5133d6 Mon Sep 17 00:00:00 2001 From: Leo Palmer Date: Tue, 28 May 2024 12:03:05 +0200 Subject: [PATCH] Enable pushing cache with --no-push Make sure we check --no-cache-push instead of --no-push when deciding whether to push cache or not. --- pkg/executor/push.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/executor/push.go b/pkg/executor/push.go index 87da3b090d..2580e314c4 100644 --- a/pkg/executor/push.go +++ b/pkg/executor/push.go @@ -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