Skip to content

Commit

Permalink
Merge pull request #3942 from laozc/image-name
Browse files Browse the repository at this point in the history
Remove arch suffixes in image names
  • Loading branch information
tstromberg authored Mar 26, 2019
2 parents 49f1f0a + a143711 commit 2a32858
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 22 deletions.
2 changes: 1 addition & 1 deletion pkg/minikube/bootstrapper/kubeadm/kubeadm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ Wants=docker.socket
[Service]
ExecStart=
ExecStart=/usr/bin/kubelet --allow-privileged=true --authorization-mode=Webhook --bootstrap-kubeconfig=/etc/kubernetes/bootstrap-kubelet.conf --cadvisor-port=0 --cgroup-driver=cgroupfs --client-ca-file=/var/lib/minikube/certs/ca.crt --cluster-dns=10.96.0.10 --cluster-domain=cluster.local --container-runtime=docker --hostname-override=minikube --kubeconfig=/etc/kubernetes/kubelet.conf --pod-infra-container-image=docker-proxy-image.io/google_containers//pause-amd64:3.0 --pod-manifest-path=/etc/kubernetes/manifests --require-kubeconfig=true
ExecStart=/usr/bin/kubelet --allow-privileged=true --authorization-mode=Webhook --bootstrap-kubeconfig=/etc/kubernetes/bootstrap-kubelet.conf --cadvisor-port=0 --cgroup-driver=cgroupfs --client-ca-file=/var/lib/minikube/certs/ca.crt --cluster-dns=10.96.0.10 --cluster-domain=cluster.local --container-runtime=docker --hostname-override=minikube --kubeconfig=/etc/kubernetes/kubelet.conf --pod-infra-container-image=docker-proxy-image.io/google_containers/pause:3.0 --pod-manifest-path=/etc/kubernetes/manifests --require-kubeconfig=true
[Install]
`,
Expand Down
49 changes: 28 additions & 21 deletions pkg/minikube/constants/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -238,32 +238,42 @@ func GetKubeadmCachedImages(imageRepository string, kubernetesVersionStr string)
minikubeRepository += "/"
}

var images = []string{
imageRepository + "kube-proxy-amd64:" + kubernetesVersionStr,
imageRepository + "kube-scheduler-amd64:" + kubernetesVersionStr,
imageRepository + "kube-controller-manager-amd64:" + kubernetesVersionStr,
imageRepository + "kube-apiserver-amd64:" + kubernetesVersionStr,
}

v1_14plus := semver.MustParseRange(">=1.14.0")
v1_13 := semver.MustParseRange(">=1.13.0 <1.14.0")
v1_12 := semver.MustParseRange(">=1.12.0 <1.13.0")
v1_11 := semver.MustParseRange(">=1.11.0 <1.12.0")
v1_10 := semver.MustParseRange(">=1.10.0 <1.11.0")
v1_9 := semver.MustParseRange(">=1.9.0 <1.10.0")
v1_8 := semver.MustParseRange(">=1.8.0 <1.9.0")
v1_12plus := semver.MustParseRange(">=1.12.0")

kubernetesVersion, err := semver.Make(strings.TrimPrefix(kubernetesVersionStr, minikubeVersion.VersionPrefix))
if err != nil {
glog.Errorln("Error parsing version semver: ", err)
}

var images []string
if v1_12plus(kubernetesVersion) {
images = append(images, []string{
imageRepository + "kube-proxy:" + kubernetesVersionStr,
imageRepository + "kube-scheduler:" + kubernetesVersionStr,
imageRepository + "kube-controller-manager:" + kubernetesVersionStr,
imageRepository + "kube-apiserver:" + kubernetesVersionStr,
}...)
} else {
images = append(images, []string{
imageRepository + "kube-proxy-amd64:" + kubernetesVersionStr,
imageRepository + "kube-scheduler-amd64:" + kubernetesVersionStr,
imageRepository + "kube-controller-manager-amd64:" + kubernetesVersionStr,
imageRepository + "kube-apiserver-amd64:" + kubernetesVersionStr,
}...)
}

var podInfraContainerImage string
if v1_14plus(kubernetesVersion) {
podInfraContainerImage = imageRepository + "pause-amd64:3.1"
podInfraContainerImage = imageRepository + "pause:3.1"
images = append(images, []string{
podInfraContainerImage,
imageRepository + "pause:3.1",
imageRepository + "k8s-dns-kube-dns-amd64:1.14.13",
imageRepository + "k8s-dns-dnsmasq-nanny-amd64:1.14.13",
imageRepository + "k8s-dns-sidecar-amd64:1.14.13",
Expand All @@ -272,34 +282,31 @@ func GetKubeadmCachedImages(imageRepository string, kubernetesVersionStr string)
}...)

} else if v1_13(kubernetesVersion) {
podInfraContainerImage = imageRepository + "pause-amd64:3.1"
podInfraContainerImage = imageRepository + "pause:3.1"
images = append(images, []string{
podInfraContainerImage,
imageRepository + "pause:3.1",
imageRepository + "k8s-dns-kube-dns-amd64:1.14.8",
imageRepository + "k8s-dns-dnsmasq-nanny-amd64:1.14.8",
imageRepository + "k8s-dns-sidecar-amd64:1.14.8",
imageRepository + "etcd-amd64:3.2.24",
imageRepository + "etcd:3.2.24",
imageRepository + "coredns:1.2.6",
}...)

} else if v1_12(kubernetesVersion) {
podInfraContainerImage = imageRepository + "pause-amd64:3.1"
podInfraContainerImage = imageRepository + "pause:3.1"
images = append(images, []string{
podInfraContainerImage,
imageRepository + "pause:3.1",
imageRepository + "k8s-dns-kube-dns-amd64:1.14.8",
imageRepository + "k8s-dns-dnsmasq-nanny-amd64:1.14.8",
imageRepository + "k8s-dns-sidecar-amd64:1.14.8",
imageRepository + "etcd-amd64:3.2.24",
imageRepository + "etcd:3.2.24",
imageRepository + "coredns:1.2.2",
}...)

} else if v1_11(kubernetesVersion) {
podInfraContainerImage = imageRepository + "pause-amd64:3.1"
podInfraContainerImage = imageRepository + "pause:3.1"
images = append(images, []string{
podInfraContainerImage,
imageRepository + "pause:3.1",
imageRepository + "k8s-dns-kube-dns-amd64:1.14.8",
imageRepository + "k8s-dns-dnsmasq-nanny-amd64:1.14.8",
imageRepository + "k8s-dns-sidecar-amd64:1.14.8",
Expand All @@ -308,7 +315,7 @@ func GetKubeadmCachedImages(imageRepository string, kubernetesVersionStr string)
}...)

} else if v1_10(kubernetesVersion) {
podInfraContainerImage = imageRepository + "pause-amd64:3.1"
podInfraContainerImage = imageRepository + "pause:3.1"
images = append(images, []string{
podInfraContainerImage,
imageRepository + "k8s-dns-kube-dns-amd64:1.14.8",
Expand All @@ -318,7 +325,7 @@ func GetKubeadmCachedImages(imageRepository string, kubernetesVersionStr string)
}...)

} else if v1_9(kubernetesVersion) {
podInfraContainerImage = imageRepository + "pause-amd64:3.0"
podInfraContainerImage = imageRepository + "pause:3.0"
images = append(images, []string{
podInfraContainerImage,
imageRepository + "k8s-dns-kube-dns-amd64:1.14.7",
Expand All @@ -328,7 +335,7 @@ func GetKubeadmCachedImages(imageRepository string, kubernetesVersionStr string)
}...)

} else if v1_8(kubernetesVersion) {
podInfraContainerImage = imageRepository + "pause-amd64:3.0"
podInfraContainerImage = imageRepository + "pause:3.0"
images = append(images, []string{
podInfraContainerImage,
imageRepository + "k8s-dns-kube-dns-amd64:1.14.5",
Expand All @@ -338,7 +345,7 @@ func GetKubeadmCachedImages(imageRepository string, kubernetesVersionStr string)
}...)

} else {
podInfraContainerImage = imageRepository + "/pause-amd64:3.0"
podInfraContainerImage = imageRepository + "pause:3.0"
}

images = append(images, []string{
Expand Down

0 comments on commit 2a32858

Please sign in to comment.