diff --git a/Makefile b/Makefile index 05c3895fc4..b5a0a1b9e4 100644 --- a/Makefile +++ b/Makefile @@ -87,8 +87,7 @@ SHA512SUM=$(shell command -v sha512sum || echo "shasum -a 512") GVISOR_TAG ?= latest # storage provisioner tag to push changes to -# to update minikubes default, update pkg/minikube/bootstrapper/images -STORAGE_PROVISIONER_TAG ?= latest +STORAGE_PROVISIONER_TAG ?= v2 # TODO: multi-arch manifest ifeq ($(GOARCH),amd64) @@ -98,7 +97,7 @@ STORAGE_PROVISIONER_IMAGE ?= $(REGISTRY)/storage-provisioner-$(GOARCH):$(STORAGE endif # Set the version information for the Kubernetes servers -MINIKUBE_LDFLAGS := -X k8s.io/minikube/pkg/version.version=$(VERSION) -X k8s.io/minikube/pkg/version.isoVersion=$(ISO_VERSION) -X k8s.io/minikube/pkg/version.isoPath=$(ISO_BUCKET) -X k8s.io/minikube/pkg/version.gitCommitID=$(COMMIT) +MINIKUBE_LDFLAGS := -X k8s.io/minikube/pkg/version.version=$(VERSION) -X k8s.io/minikube/pkg/version.isoVersion=$(ISO_VERSION) -X k8s.io/minikube/pkg/version.isoPath=$(ISO_BUCKET) -X k8s.io/minikube/pkg/version.gitCommitID=$(COMMIT) -X k8s.io/minikube/pkg/version.storageProvisionerVersion=$(STORAGE_PROVISIONER_TAG) PROVISIONER_LDFLAGS := "-X k8s.io/minikube/pkg/storage.version=$(STORAGE_PROVISIONER_TAG) -s -w -extldflags '-static'" MINIKUBEFILES := ./cmd/minikube/ diff --git a/deploy/addons/storage-provisioner/storage-provisioner.yaml.tmpl b/deploy/addons/storage-provisioner/storage-provisioner.yaml.tmpl index 7f137aa374..1c1181f6f5 100644 --- a/deploy/addons/storage-provisioner/storage-provisioner.yaml.tmpl +++ b/deploy/addons/storage-provisioner/storage-provisioner.yaml.tmpl @@ -98,7 +98,7 @@ spec: hostNetwork: true containers: - name: storage-provisioner - image: {{default "gcr.io/k8s-minikube" .ImageRepository}}/storage-provisioner{{.ExoticArch}}:v1.8.1 + image: {{default "gcr.io/k8s-minikube" .ImageRepository}}/storage-provisioner{{.ExoticArch}}:{{.StorageProvisionerVersion}} command: ["/storage-provisioner"] imagePullPolicy: IfNotPresent volumeMounts: diff --git a/pkg/minikube/assets/addons.go b/pkg/minikube/assets/addons.go index 73b2d46854..e557a96b2c 100644 --- a/pkg/minikube/assets/addons.go +++ b/pkg/minikube/assets/addons.go @@ -22,6 +22,7 @@ import ( "k8s.io/minikube/pkg/minikube/config" "k8s.io/minikube/pkg/minikube/constants" "k8s.io/minikube/pkg/minikube/vmpath" + "k8s.io/minikube/pkg/version" ) // Addon is a named list of assets, that can be enabled @@ -452,17 +453,19 @@ func GenerateTemplateData(cfg config.KubernetesConfig) interface{} { ea = "-" + runtime.GOARCH } opts := struct { - Arch string - ExoticArch string - ImageRepository string - LoadBalancerStartIP string - LoadBalancerEndIP string + Arch string + ExoticArch string + ImageRepository string + LoadBalancerStartIP string + LoadBalancerEndIP string + StorageProvisionerVersion string }{ - Arch: a, - ExoticArch: ea, - ImageRepository: cfg.ImageRepository, - LoadBalancerStartIP: cfg.LoadBalancerStartIP, - LoadBalancerEndIP: cfg.LoadBalancerEndIP, + Arch: a, + ExoticArch: ea, + ImageRepository: cfg.ImageRepository, + LoadBalancerStartIP: cfg.LoadBalancerStartIP, + LoadBalancerEndIP: cfg.LoadBalancerEndIP, + StorageProvisionerVersion: version.GetStorageProvisionerVersion(), } return opts diff --git a/pkg/minikube/bootstrapper/images/images.go b/pkg/minikube/bootstrapper/images/images.go index 1092e2abdf..b066dcc8bb 100644 --- a/pkg/minikube/bootstrapper/images/images.go +++ b/pkg/minikube/bootstrapper/images/images.go @@ -23,6 +23,7 @@ import ( "runtime" "github.com/blang/semver" + "k8s.io/minikube/pkg/version" ) // Pause returns the image name to pull for a given Kubernetes version @@ -127,7 +128,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)+"v1.8.1") + return path.Join(minikubeRepo(mirror), "storage-provisioner"+archTag(false)+version.GetStorageProvisionerVersion()) } // dashboardFrontend returns the image used for the dashboard frontend diff --git a/pkg/minikube/bootstrapper/images/images_test.go b/pkg/minikube/bootstrapper/images/images_test.go index 657d43a51c..2bc369b87c 100644 --- a/pkg/minikube/bootstrapper/images/images_test.go +++ b/pkg/minikube/bootstrapper/images/images_test.go @@ -24,7 +24,7 @@ import ( func TestAuxiliary(t *testing.T) { want := []string{ - "gcr.io/k8s-minikube/storage-provisioner:v1.8.1", + "gcr.io/k8s-minikube/storage-provisioner:v2", "kubernetesui/dashboard:v2.0.1", "kubernetesui/metrics-scraper:v1.0.4", } @@ -36,7 +36,7 @@ func TestAuxiliary(t *testing.T) { func TestAuxiliaryMirror(t *testing.T) { want := []string{ - "test.mirror/storage-provisioner:v1.8.1", + "test.mirror/storage-provisioner:v2", "test.mirror/dashboard:v2.0.1", "test.mirror/metrics-scraper:v1.0.4", } diff --git a/pkg/minikube/bootstrapper/images/kubeadm_test.go b/pkg/minikube/bootstrapper/images/kubeadm_test.go index d95ca2fd45..f1348ce901 100644 --- a/pkg/minikube/bootstrapper/images/kubeadm_test.go +++ b/pkg/minikube/bootstrapper/images/kubeadm_test.go @@ -37,7 +37,7 @@ func TestKubeadmImages(t *testing.T) { "k8s.gcr.io/coredns:1.6.5", "k8s.gcr.io/etcd:3.4.3-0", "k8s.gcr.io/pause:3.1", - "gcr.io/k8s-minikube/storage-provisioner:v1.8.1", + "gcr.io/k8s-minikube/storage-provisioner:v2", "kubernetesui/dashboard:v2.0.1", "kubernetesui/metrics-scraper:v1.0.4", }}, @@ -49,7 +49,7 @@ func TestKubeadmImages(t *testing.T) { "mirror.k8s.io/coredns:1.6.2", "mirror.k8s.io/etcd:3.3.15-0", "mirror.k8s.io/pause:3.1", - "mirror.k8s.io/storage-provisioner:v1.8.1", + "mirror.k8s.io/storage-provisioner:v2", "mirror.k8s.io/dashboard:v2.0.1", "mirror.k8s.io/metrics-scraper:v1.0.4", }}, @@ -61,7 +61,7 @@ func TestKubeadmImages(t *testing.T) { "k8s.gcr.io/coredns:1.3.1", "k8s.gcr.io/etcd:3.3.10", "k8s.gcr.io/pause:3.1", - "gcr.io/k8s-minikube/storage-provisioner:v1.8.1", + "gcr.io/k8s-minikube/storage-provisioner:v2", "kubernetesui/dashboard:v2.0.1", "kubernetesui/metrics-scraper:v1.0.4", }}, @@ -73,7 +73,7 @@ func TestKubeadmImages(t *testing.T) { "k8s.gcr.io/coredns:1.3.1", "k8s.gcr.io/etcd:3.3.10", "k8s.gcr.io/pause:3.1", - "gcr.io/k8s-minikube/storage-provisioner:v1.8.1", + "gcr.io/k8s-minikube/storage-provisioner:v2", "kubernetesui/dashboard:v2.0.1", "kubernetesui/metrics-scraper:v1.0.4", }}, @@ -85,7 +85,7 @@ func TestKubeadmImages(t *testing.T) { "k8s.gcr.io/coredns:1.2.6", "k8s.gcr.io/etcd:3.2.24", "k8s.gcr.io/pause:3.1", - "gcr.io/k8s-minikube/storage-provisioner:v1.8.1", + "gcr.io/k8s-minikube/storage-provisioner:v2", "kubernetesui/dashboard:v2.0.1", "kubernetesui/metrics-scraper:v1.0.4", }}, @@ -97,7 +97,7 @@ func TestKubeadmImages(t *testing.T) { "k8s.gcr.io/coredns:1.2.2", "k8s.gcr.io/etcd:3.2.24", "k8s.gcr.io/pause:3.1", - "gcr.io/k8s-minikube/storage-provisioner:v1.8.1", + "gcr.io/k8s-minikube/storage-provisioner:v2", "kubernetesui/dashboard:v2.0.1", "kubernetesui/metrics-scraper:v1.0.4", }}, diff --git a/pkg/minikube/cruntime/containerd_test.go b/pkg/minikube/cruntime/containerd_test.go index 5f99033daa..5b1e6414f9 100644 --- a/pkg/minikube/cruntime/containerd_test.go +++ b/pkg/minikube/cruntime/containerd_test.go @@ -27,7 +27,7 @@ func TestAddRepoTagToImageName(t *testing.T) { }{ {"kubernetesui/dashboard:v2.0.1", "docker.io/kubernetesui/dashboard:v2.0.1"}, {"kubernetesui/metrics-scraper:v1.0.4", "docker.io/kubernetesui/metrics-scraper:v1.0.4"}, - {"gcr.io/k8s-minikube/storage-provisioner:v1.8.1", "gcr.io/k8s-minikube/storage-provisioner:v1.8.1"}, + {"gcr.io/k8s-minikube/storage-provisioner:v2", "gcr.io/k8s-minikube/storage-provisioner:v2"}, } for _, tc := range tests { t.Run(tc.imgName, func(t *testing.T) { diff --git a/pkg/version/version.go b/pkg/version/version.go index a3b921c5ca..0faeb4964f 100644 --- a/pkg/version/version.go +++ b/pkg/version/version.go @@ -34,6 +34,9 @@ var gitCommitID = "" // isoVersion is a private field and should be set when compiling with --ldflags="-X k8s.io/minikube/pkg/version.isoVersion=vX.Y.Z" var isoVersion = "v0.0.0-unset" +// storageProvisionerVersion is a private field and should be set when compiling with --ldflags="-X k8s.io/minikube/pkg/version.storageProvisionerVersion=" +var storageProvisionerVersion = "" + // GetVersion returns the current minikube version func GetVersion() string { return version @@ -53,3 +56,8 @@ func GetISOVersion() string { func GetSemverVersion() (semver.Version, error) { return semver.Make(strings.TrimPrefix(GetVersion(), VersionPrefix)) } + +// GetStorageProvisionerVersion returns the storage provisioner version +func GetStorageProvisionerVersion() string { + return storageProvisionerVersion +}