From 5ed45ed2fb7dd5ec8aa6cee9724c4ee1ea1e952d Mon Sep 17 00:00:00 2001 From: Carlos Sanchez Date: Tue, 6 Nov 2018 22:44:44 +0100 Subject: [PATCH] Preserve options when doing a cache push (#423) * Preserve options when doing a cache push Otherwise options like `insecure` are lost * Do not override original object --- pkg/executor/push.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/executor/push.go b/pkg/executor/push.go index dcf49a647f..796c17cf77 100644 --- a/pkg/executor/push.go +++ b/pkg/executor/push.go @@ -126,7 +126,7 @@ func pushLayerToCache(opts *config.KanikoOptions, cacheKey string, layer v1.Laye if err != nil { return errors.Wrap(err, "appending layer onto empty image") } - return DoPush(empty, &config.KanikoOptions{ - Destinations: []string{cache}, - }) + cacheOpts := *opts + cacheOpts.Destinations = []string{cache} + return DoPush(empty, &cacheOpts) }