kubeadm - fix upgrades with static pod etcd
This commit is contained in:
		@@ -37,7 +37,6 @@ import (
 | 
			
		||||
	"k8s.io/kubernetes/cmd/kubeadm/app/util/apiclient"
 | 
			
		||||
	configutil "k8s.io/kubernetes/cmd/kubeadm/app/util/config"
 | 
			
		||||
	dryrunutil "k8s.io/kubernetes/cmd/kubeadm/app/util/dryrun"
 | 
			
		||||
	etcdutil "k8s.io/kubernetes/cmd/kubeadm/app/util/etcd"
 | 
			
		||||
	"k8s.io/kubernetes/pkg/util/version"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
@@ -277,9 +276,8 @@ func PerformStaticPodUpgrade(client clientset.Interface, waiter apiclient.Waiter
 | 
			
		||||
		return err
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	// These are uninitialized because passing in the clients allow for mocking the client during testing
 | 
			
		||||
	var oldEtcdClient, newEtdClient etcdutil.Client
 | 
			
		||||
	return upgrade.StaticPodControlPlane(waiter, pathManager, internalcfg, etcdUpgrade, oldEtcdClient, newEtdClient)
 | 
			
		||||
	// The arguments oldEtcdClient and newEtdClient, are uninitialized because passing in the clients allow for mocking the client during testing
 | 
			
		||||
	return upgrade.StaticPodControlPlane(waiter, pathManager, internalcfg, etcdUpgrade, nil, nil)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// DryRunStaticPodUpgrade fakes an upgrade of the control plane
 | 
			
		||||
 
 | 
			
		||||
@@ -133,14 +133,10 @@ func (c Client) GetVersion() (string, error) {
 | 
			
		||||
		return "", err
 | 
			
		||||
	}
 | 
			
		||||
	for _, v := range versions {
 | 
			
		||||
		if clusterVersion == "" {
 | 
			
		||||
			// This is the first version we've seen
 | 
			
		||||
			clusterVersion = v
 | 
			
		||||
		} else if v != clusterVersion {
 | 
			
		||||
		if clusterVersion != "" && clusterVersion != v {
 | 
			
		||||
			return "", fmt.Errorf("etcd cluster contains endpoints with mismatched versions: %v", versions)
 | 
			
		||||
		} else {
 | 
			
		||||
			clusterVersion = v
 | 
			
		||||
		}
 | 
			
		||||
		clusterVersion = v
 | 
			
		||||
	}
 | 
			
		||||
	if clusterVersion == "" {
 | 
			
		||||
		return "", fmt.Errorf("could not determine cluster etcd version")
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user