From 4d883f2c70d3f2abef4e039b414a556060fa2a94 Mon Sep 17 00:00:00 2001 From: Carlos Sanchez Date: Sat, 29 Sep 2018 21:44:54 +0200 Subject: [PATCH 1/2] Preserve options when doing a cache push Otherwise options like `insecure` are lost --- 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..c90d5f0509 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) } From a8fea260288e3605ca5700cd3eec0545a315f372 Mon Sep 17 00:00:00 2001 From: Carlos Sanchez Date: Fri, 2 Nov 2018 18:14:43 +0100 Subject: [PATCH 2/2] Do not override original object --- pkg/executor/push.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/executor/push.go b/pkg/executor/push.go index c90d5f0509..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") } - cacheOpts := opts + cacheOpts := *opts cacheOpts.Destinations = []string{cache} - return DoPush(empty, cacheOpts) + return DoPush(empty, &cacheOpts) }