From 7b50fc8a57563e6401456154c962a6a345eae652 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20N=C3=BCtzi?= Date: Tue, 17 May 2022 19:27:24 +0200 Subject: [PATCH] fix: Main (#2094) --- pkg/config/options.go | 1 + pkg/executor/push.go | 9 ++++----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pkg/config/options.go b/pkg/config/options.go index 7ee286d2c..b8214ca97 100644 --- a/pkg/config/options.go +++ b/pkg/config/options.go @@ -69,6 +69,7 @@ type KanikoOptions struct { SingleSnapshot bool Reproducible bool NoPush bool + NoPushCache bool Cache bool Cleanup bool CompressedCaching bool diff --git a/pkg/executor/push.go b/pkg/executor/push.go index a76c2a1d2..7ee277344 100644 --- a/pkg/executor/push.go +++ b/pkg/executor/push.go @@ -79,12 +79,11 @@ var ( func CheckPushPermissions(opts *config.KanikoOptions) error { targets := opts.Destinations // When no push and no push cache are set, we don't need to check permissions - if opts.NoPush && opt.noPushCache { + if opts.NoPush && opts.NoPushCache { targets = []string{} - } - // When no push is set, we want to check permissions for the cache repo - // instead of the destinations - else if opts.NoPush && ! opt.noPushCache { + } else if opts.NoPush && !opts.NoPushCache { + // When no push is set, we want to check permissions for the cache repo + // instead of the destinations targets = []string{opts.CacheRepo} }