Merge branch 'master' into go-container

pull/9158/head
Thomas Stromberg 2020-09-02 10:18:44 -07:00
commit 7a6398475e
8 changed files with 21 additions and 11 deletions

View File

@ -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)

2
go.mod
View File

@ -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

2
go.sum
View File

@ -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=

View File

@ -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",
}

View File

@ -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",
}},

View File

@ -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")

View File

@ -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) {

View File

@ -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{