From 9908eeb30a773eb4bbf5fa4bd1a9c35229201792 Mon Sep 17 00:00:00 2001 From: Priya Wadhwa Date: Fri, 26 Oct 2018 11:38:32 -0700 Subject: [PATCH] Use remoteImage function when getting digest for cache Issue #410 experienced an error with base image caching where they were "Not Authorized" to get information for a remote image, but later were able to download and extract the base image. To fix this, we can switch to using the remoteImage function for getting information about the digest, which is the same function used for downloading base images. This way we can also take advantage of the --insecure and --skip-tls-verify flags if users pass those in when trying to get digests for the cache as well. --- pkg/util/image_util.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/util/image_util.go b/pkg/util/image_util.go index 8c2c30141..991a54e5f 100644 --- a/pkg/util/image_util.go +++ b/pkg/util/image_util.go @@ -142,7 +142,7 @@ func cachedImage(opts *config.KanikoOptions, image string) (v1.Image, error) { if d, ok := ref.(name.Digest); ok { cacheKey = d.DigestStr() } else { - img, err := remote.Image(ref) + img, err := remoteImage(image, opts) if err != nil { return nil, err }