Skip to content

Commit

Permalink
Updated to make code clearer for newer versions and remove duplicatio…
Browse files Browse the repository at this point in the history
…n of image names
  • Loading branch information
mlgibbons authored and dlorenc committed Jun 5, 2018
1 parent abdcd2c commit e37d615
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions pkg/minikube/constants/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ func GetKubeadmCachedImages(kubernetesVersionStr string) []string {
"k8s.gcr.io/kube-apiserver-amd64:" + kubernetesVersionStr,
}

gt_v1_10 := semver.MustParseRange(">=1.11.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")
Expand All @@ -236,7 +237,7 @@ func GetKubeadmCachedImages(kubernetesVersionStr string) []string {
glog.Errorln("Error parsing version semver: ", err)
}

if v1_10(kubernetesVersion) {
if v1_10(kubernetesVersion) || gt_v1_10(kubernetesVersion) {
images = append(images, []string{
"k8s.gcr.io/pause-amd64:3.1",
"k8s.gcr.io/k8s-dns-kube-dns-amd64:1.14.8",
Expand All @@ -262,15 +263,6 @@ func GetKubeadmCachedImages(kubernetesVersionStr string) []string {
"k8s.gcr.io/k8s-dns-sidecar-amd64:1.14.5",
"k8s.gcr.io/etcd-amd64:3.0.17",
}...)

} else {
images = append(images, []string{
"k8s.gcr.io/pause-amd64:3.1",
"k8s.gcr.io/k8s-dns-kube-dns-amd64:1.14.8",
"k8s.gcr.io/k8s-dns-dnsmasq-nanny-amd64:1.14.8",
"k8s.gcr.io/k8s-dns-sidecar-amd64:1.14.8",
"k8s.gcr.io/etcd-amd64:3.1.12",
}...)
}

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

0 comments on commit e37d615

Please sign in to comment.