Merge pull request #10146 from tstromberg/macos-arm64

arm64: Fix offline start by removing obsolete arch suffix
pull/9985/head^2
Medya Ghazizadeh 2021-01-14 17:19:02 -08:00 committed by GitHub
commit 3b2d9628ff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 26 deletions

View File

@ -20,7 +20,6 @@ package images
import (
"fmt"
"path"
"runtime"
"github.com/blang/semver"
"k8s.io/minikube/pkg/version"
@ -34,7 +33,7 @@ func Pause(v semver.Version, mirror string) string {
if semver.MustParseRange("<1.18.0-alpha.0")(v) {
pv = "3.1"
}
return path.Join(kubernetesRepo(mirror), "pause"+archTag(false)+pv)
return path.Join(kubernetesRepo(mirror), "pause:"+pv)
}
// essentials returns images needed too bootstrap a Kubernetes
@ -53,13 +52,7 @@ func essentials(mirror string, v semver.Version) []string {
// componentImage returns a Kubernetes component image to pull
func componentImage(name string, v semver.Version, mirror string) string {
needsArchSuffix := false
ancient := semver.MustParseRange("<1.12.0")
if ancient(v) {
needsArchSuffix = true
}
return fmt.Sprintf("%sv%s", path.Join(kubernetesRepo(mirror), name+archTag(needsArchSuffix)), v)
return fmt.Sprintf("%s:v%s", path.Join(kubernetesRepo(mirror), name), v)
}
// coreDNS returns the images used for CoreDNS
@ -83,17 +76,11 @@ func coreDNS(v semver.Version, mirror string) string {
case 11:
cv = "1.1.3"
}
return path.Join(kubernetesRepo(mirror), "coredns"+":"+cv)
return path.Join(kubernetesRepo(mirror), "coredns:"+cv)
}
// etcd returns the image used for etcd
func etcd(v semver.Version, mirror string) string {
needsArchSuffix := false
ancient := semver.MustParseRange("<1.12.0")
if ancient(v) {
needsArchSuffix = true
}
// Should match `DefaultEtcdVersion` in:
// https://github.com/kubernetes/kubernetes/blob/master/cmd/kubeadm/app/constants/constants.go
ev := "3.4.13-0"
@ -116,15 +103,7 @@ func etcd(v semver.Version, mirror string) string {
ev = "3.4.9-1"
}
return path.Join(kubernetesRepo(mirror), "etcd"+archTag(needsArchSuffix)+ev)
}
// archTag returns a CPU architecture suffix for images
func archTag(hasTag bool) string {
if runtime.GOARCH == "amd64" && !hasTag {
return ":"
}
return "-" + runtime.GOARCH + ":"
return path.Join(kubernetesRepo(mirror), "etcd:"+ev)
}
// auxiliary returns images that are helpful for running minikube
@ -139,7 +118,7 @@ func auxiliary(mirror string) []string {
// storageProvisioner returns the minikube storage provisioner image
func storageProvisioner(mirror string) string {
return path.Join(minikubeRepo(mirror), "storage-provisioner"+archTag(false)+version.GetStorageProvisionerVersion())
return path.Join(minikubeRepo(mirror), "storage-provisioner:"+version.GetStorageProvisionerVersion())
}
// dashboardFrontend returns the image used for the dashboard frontend