🔧 Use crane.Insecure while checking image availability

As those checks are not consuming any digest, we just use them to assess
if we need to build or not certain packages. The backend will refuse the
image if not configured appropriately
This commit is contained in:
Ettore Di Giacinto
2021-12-28 14:54:09 +01:00
parent 39e62f3321
commit 7e825400e2
2 changed files with 4 additions and 2 deletions

View File

@@ -36,7 +36,7 @@ func TreePackages(treedir string) (searchResult SearchResult, err error) {
} }
func imageAvailable(image string) bool { func imageAvailable(image string) bool {
_, err := crane.Digest(image) _, err := crane.Digest(image, crane.Insecure)
return err == nil return err == nil
} }

View File

@@ -29,7 +29,9 @@ const (
) )
func imageAvailable(image string) bool { func imageAvailable(image string) bool {
_, err := crane.Digest(image) // We use crane.insecure as we just check if the image is available
// It's the daemon duty to use it or not based on the host settings
_, err := crane.Digest(image, crane.Insecure)
return err == nil return err == nil
} }