diff --git a/Makefile b/Makefile index 01f2a4efb5..9596646f03 100644 --- a/Makefile +++ b/Makefile @@ -92,7 +92,7 @@ SHA512SUM=$(shell command -v sha512sum || echo "shasum -a 512") GVISOR_TAG ?= latest # storage provisioner tag to push changes to -STORAGE_PROVISIONER_TAG ?= v2 +STORAGE_PROVISIONER_TAG ?= v3 # TODO: multi-arch manifest ifeq ($(GOARCH),amd64) diff --git a/go.mod b/go.mod index 22758a2ea2..225bdf9537 100644 --- a/go.mod +++ b/go.mod @@ -93,7 +93,7 @@ replace ( git.apache.org/thrift.git => github.com/apache/thrift v0.0.0-20180902110319-2566ecd5d999 github.com/docker/docker => github.com/docker/docker v1.4.2-0.20190924003213-a8608b5b67c7 github.com/docker/machine => github.com/machine-drivers/machine v0.7.1-0.20200810185219-7d42fed1b770 - github.com/google/go-containerregistry => github.com/afbjorklund/go-containerregistry v0.0.0-20200602203322-347d93793dc9 + github.com/google/go-containerregistry => github.com/afbjorklund/go-containerregistry v0.0.0-20200902152226-fbad78ec2813 github.com/hashicorp/go-getter => github.com/afbjorklund/go-getter v1.4.1-0.20190910175809-eb9f6c26742c github.com/samalba/dockerclient => github.com/sayboras/dockerclient v1.0.0 k8s.io/api => k8s.io/api v0.17.3 diff --git a/go.sum b/go.sum index aebb375651..93738c41ea 100644 --- a/go.sum +++ b/go.sum @@ -119,6 +119,8 @@ github.com/VividCortex/ewma v1.1.1 h1:MnEK4VOv6n0RSY4vtRe3h11qjxL3+t0B8yOL8iMXdc github.com/VividCortex/ewma v1.1.1/go.mod h1:2Tkkvm3sRDVXaiyucHiACn4cqf7DpdyLvmxzcbUokwA= github.com/afbjorklund/go-containerregistry v0.0.0-20200602203322-347d93793dc9 h1:EMF82QM65iOfQTQefF5d5SCsSsXsh6aSdcq9U1KC3Lc= github.com/afbjorklund/go-containerregistry v0.0.0-20200602203322-347d93793dc9/go.mod h1:npTSyywOeILcgWqd+rvtzGWflIPPcBQhYoOONaY4ltM= +github.com/afbjorklund/go-containerregistry v0.0.0-20200902152226-fbad78ec2813 h1:0tskN1ipU/BBrpoEIy0rdZS9jf5+wdP6IMRak8Iu/YE= +github.com/afbjorklund/go-containerregistry v0.0.0-20200902152226-fbad78ec2813/go.mod h1:npTSyywOeILcgWqd+rvtzGWflIPPcBQhYoOONaY4ltM= github.com/afbjorklund/go-getter v1.4.1-0.20190910175809-eb9f6c26742c h1:18gEt7qzn7CW7qMkfPTFyyotlPbvPQo9o4IDV8jZqP4= github.com/afbjorklund/go-getter v1.4.1-0.20190910175809-eb9f6c26742c/go.mod h1:7qxyCd8rBfcShwsvxgIguu4KbS3l8bUCwg2Umn7RjeY= github.com/agnivade/levenshtein v1.0.1/go.mod h1:CURSv5d9Uaml+FovSIICkLbAUZ9S4RqaHDIsdSBg7lM= diff --git a/pkg/minikube/bootstrapper/images/images_test.go b/pkg/minikube/bootstrapper/images/images_test.go index 5b7fe84809..3aeb0f8155 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:v2", + "gcr.io/k8s-minikube/storage-provisioner:v3", "kubernetesui/dashboard:v2.0.3", "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:v2", + "test.mirror/storage-provisioner:v3", "test.mirror/dashboard:v2.0.3", "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 0880fb0994..76a92966a9 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:v2", + "gcr.io/k8s-minikube/storage-provisioner:v3", "kubernetesui/dashboard:v2.0.3", "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:v2", + "mirror.k8s.io/storage-provisioner:v3", "mirror.k8s.io/dashboard:v2.0.3", "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:v2", + "gcr.io/k8s-minikube/storage-provisioner:v3", "kubernetesui/dashboard:v2.0.3", "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:v2", + "gcr.io/k8s-minikube/storage-provisioner:v3", "kubernetesui/dashboard:v2.0.3", "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:v2", + "gcr.io/k8s-minikube/storage-provisioner:v3", "kubernetesui/dashboard:v2.0.3", "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:v2", + "gcr.io/k8s-minikube/storage-provisioner:v3", "kubernetesui/dashboard:v2.0.3", "kubernetesui/metrics-scraper:v1.0.4", }}, diff --git a/pkg/minikube/bootstrapper/kubeadm/kubeadm.go b/pkg/minikube/bootstrapper/kubeadm/kubeadm.go index 96a21807fd..a0b2163cb7 100644 --- a/pkg/minikube/bootstrapper/kubeadm/kubeadm.go +++ b/pkg/minikube/bootstrapper/kubeadm/kubeadm.go @@ -51,6 +51,7 @@ import ( "k8s.io/minikube/pkg/minikube/constants" "k8s.io/minikube/pkg/minikube/cruntime" "k8s.io/minikube/pkg/minikube/driver" + "k8s.io/minikube/pkg/minikube/kubeconfig" "k8s.io/minikube/pkg/minikube/machine" "k8s.io/minikube/pkg/minikube/out" "k8s.io/minikube/pkg/minikube/out/register" @@ -538,6 +539,12 @@ func (k *Bootstrapper) restartControlPlane(cfg config.ClusterConfig) error { return errors.Wrap(err, "control plane") } + // Save the costly tax of reinstalling Kubernetes if the only issue is a missing kube context + _, err = kubeconfig.UpdateEndpoint(cfg.Name, hostname, port, kubeconfig.PathFromEnv()) + if err != nil { + glog.Warningf("unable to update kubeconfig (cluster will likely require a reset): %v", err) + } + client, err := k.client(hostname, port) if err != nil { return errors.Wrap(err, "getting k8s client") diff --git a/pkg/minikube/cruntime/containerd_test.go b/pkg/minikube/cruntime/containerd_test.go index 93a58ae001..7fb4846f38 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.3", "docker.io/kubernetesui/dashboard:v2.0.3"}, {"kubernetesui/metrics-scraper:v1.0.4", "docker.io/kubernetesui/metrics-scraper:v1.0.4"}, - {"gcr.io/k8s-minikube/storage-provisioner:v2", "gcr.io/k8s-minikube/storage-provisioner:v2"}, + {"gcr.io/k8s-minikube/storage-provisioner:v3", "gcr.io/k8s-minikube/storage-provisioner:v3"}, } for _, tc := range tests { t.Run(tc.imgName, func(t *testing.T) { diff --git a/pkg/minikube/kubeconfig/kubeconfig.go b/pkg/minikube/kubeconfig/kubeconfig.go index 5cda239f2c..fc2a09e6fa 100644 --- a/pkg/minikube/kubeconfig/kubeconfig.go +++ b/pkg/minikube/kubeconfig/kubeconfig.go @@ -125,6 +125,7 @@ func UpdateEndpoint(contextName string, hostname string, port int, confpath stri // if the cluster setting is missed in the kubeconfig, create new one if _, ok := cfg.Clusters[contextName]; !ok { + glog.Infof("%q context is missing from %s - will repair!", contextName, confpath) lp := localpath.Profile(contextName) gp := localpath.MiniPath() kcs := &Settings{