diff --git a/pkg/drivers/kic/kic.go b/pkg/drivers/kic/kic.go index 290aab072210..6d443d05e57c 100644 --- a/pkg/drivers/kic/kic.go +++ b/pkg/drivers/kic/kic.go @@ -133,7 +133,7 @@ func (d *Driver) Create() error { t := time.Now() glog.Infof("Starting extracting preloaded images to volume ...") // Extract preloaded images to container - if err := oci.ExtractTarballToVolume(d.NodeConfig.OCIBinary, download.TarballPath(d.NodeConfig.KubernetesVersion, d.NodeConfig.ContainerRuntime), params.Name, BaseImage); err != nil { + if err := oci.ExtractTarballToVolume(d.NodeConfig.OCIBinary, download.TarballPath(d.NodeConfig.KubernetesVersion, d.NodeConfig.ContainerRuntime), params.Name, d.NodeConfig.ImageDigest); err != nil { glog.Infof("Unable to extract preloaded tarball to volume: %v", err) } else { glog.Infof("duration metric: took %f seconds to extract preloaded images to volume", time.Since(t).Seconds()) diff --git a/pkg/drivers/kic/types.go b/pkg/drivers/kic/types.go index fd7596f3261c..0c72538c00bf 100644 --- a/pkg/drivers/kic/types.go +++ b/pkg/drivers/kic/types.go @@ -35,10 +35,15 @@ const ( var ( // BaseImage is the base image is used to spin up kic containers. it uses same base-image as kind. BaseImage = fmt.Sprintf("gcr.io/k8s-minikube/kicbase:%s@sha256:%s", Version, baseImageSHA) - // BaseImageFallBack the fall back of BaseImage in case gcr.io is not available. stored in github packages https://github.com/kubernetes/minikube/packages/206071 + + // BaseImageFallBack1 the fall back of BaseImage in case gcr.io is not available. stored in docker hub + // same image is push to https://github.com/kicbase/stable + BaseImageFallBack1 = fmt.Sprintf("kicbase/stable:%s@sha256:%s", Version, baseImageSHA) + + // BaseImageFallBack2 the fall back of BaseImage in case gcr.io is not available. stored in github packages https://github.com/kubernetes/minikube/packages/206071 // github packages docker does _NOT_ support pulling by sha as mentioned in the docs: // https://help.github.com/en/packages/using-github-packages-with-your-projects-ecosystem/configuring-docker-for-use-with-github-packages - BaseImageFallBack = fmt.Sprintf("docker.pkg.github.com/kubernetes/minikube/kicbase:%s", Version) + BaseImageFallBack2 = fmt.Sprintf("docker.pkg.github.com/kubernetes/minikube/kicbase:%s", Version) ) // Config is configuration for the kic driver used by registry diff --git a/pkg/minikube/node/cache.go b/pkg/minikube/node/cache.go index 2de6f6a130b8..c8a413aa2f34 100644 --- a/pkg/minikube/node/cache.go +++ b/pkg/minikube/node/cache.go @@ -111,9 +111,13 @@ func beginDownloadKicArtifacts(g *errgroup.Group, cc *config.ClusterConfig) { glog.Infof("Downloading %s to local daemon", cc.KicBaseImage) err := image.WriteImageToDaemon(cc.KicBaseImage) if err != nil { - glog.Infof("failed to download base-image %q will try to download the fallback base-image %q instead.", cc.KicBaseImage, kic.BaseImageFallBack) - cc.KicBaseImage = kic.BaseImageFallBack - return image.WriteImageToDaemon(kic.BaseImageFallBack) + glog.Infof("failed to download base-image %q will try to download the fallback base-image %q instead.", cc.KicBaseImage, kic.BaseImageFallBack1) + cc.KicBaseImage = kic.BaseImageFallBack1 + if err := image.WriteImageToDaemon(kic.BaseImageFallBack1); err != nil { + cc.KicBaseImage = kic.BaseImageFallBack2 + glog.Infof("failed to docker hub base-image %q will try to download the github packages base-image %q instead.", cc.KicBaseImage, kic.BaseImageFallBack2) + return image.WriteImageToDaemon(kic.BaseImageFallBack2) + } } return nil }) diff --git a/test/integration/fn_mount_cmd.go b/test/integration/fn_mount_cmd.go index 306fd5482ef0..129be9b526c8 100644 --- a/test/integration/fn_mount_cmd.go +++ b/test/integration/fn_mount_cmd.go @@ -43,7 +43,7 @@ const ( createdByPodRemovedByTest = "created-by-pod-removed-by-test" ) -func validateMountCmd(ctx context.Context, t *testing.T, profile string) { // nolint: cyclomatic complexity 31 +func validateMountCmd(ctx context.Context, t *testing.T, profile string) { // nolint if NoneDriver() { t.Skip("skipping: none driver does not support mount") }