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.
This commit is contained in:
parent
1639d1d71c
commit
9908eeb30a
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue