feat: add flag to disable pushing cache (#2038)

This commit is contained in:
Jason D'Amour
2022-05-16 12:21:26 -07:00
committed by GitHub
parent ce1fb51579
commit 872758b8b0
3 changed files with 8 additions and 3 deletions
+6 -2
View File
@@ -78,9 +78,13 @@ var (
// push to every specified destination.
func CheckPushPermissions(opts *config.KanikoOptions) error {
targets := opts.Destinations
// When no push is set, whe want to check permissions for the cache repo
// When no push and no push cache are set, we don't need to check permissions
if opts.NoPush && opt.noPushCache {
targets = []string{}
}
// When no push is set, we want to check permissions for the cache repo
// instead of the destinations
if opts.NoPush {
else if opts.NoPush && ! opt.noPushCache {
targets = []string{opts.CacheRepo}
}