mirror of
https://github.com/GoogleContainerTools/kaniko
synced 2026-10-19 19:10:25 +02:00
feat: add flag to disable pushing cache (#2038)
This commit is contained in:
@@ -420,7 +420,7 @@ func (s *stageBuilder) build() error {
|
||||
logrus.Debugf("build: cache key for command %v %v", command.String(), ck)
|
||||
|
||||
// Push layer to cache (in parallel) now along with new config file
|
||||
if command.ShouldCacheOutput() {
|
||||
if command.ShouldCacheOutput() && ! s.opts.NoPushCache {
|
||||
cacheGroup.Go(func() error {
|
||||
return s.pushLayerToCache(s.opts, ck, tarPath, command.String())
|
||||
})
|
||||
|
||||
@@ -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}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user