This commit is contained in:
Gabriel Nützi 2022-05-17 19:27:24 +02:00 committed by GitHub
parent 872758b8b0
commit 7b50fc8a57
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View File

@ -69,6 +69,7 @@ type KanikoOptions struct {
SingleSnapshot bool
Reproducible bool
NoPush bool
NoPushCache bool
Cache bool
Cleanup bool
CompressedCaching bool

View File

@ -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}
}