mirror of
https://github.com/rancher/rke.git
synced 2025-08-17 06:16:58 +00:00
Merge pull request #32 from galal-hussein/check_cluster_state
Check if the cluster state is empty before upgrade
This commit is contained in:
commit
1e8d1cc8d4
@ -144,13 +144,17 @@ func ClusterUpgrade(clusterFile string) (string, string, string, string, error)
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return APIURL, caCrt, clientCert, clientKey, err
|
return APIURL, caCrt, clientCert, clientKey, err
|
||||||
}
|
}
|
||||||
logrus.Debugf("Setting up upgrade tunnels")
|
|
||||||
|
if currentCluster == nil {
|
||||||
|
return APIURL, caCrt, clientCert, clientKey, fmt.Errorf("Failed to get the current state of Kubernetes cluster")
|
||||||
|
}
|
||||||
/*
|
/*
|
||||||
kubeCluster is the cluster.yaml definition. It should have updated configuration
|
kubeCluster is the cluster.yaml definition. It should have updated configuration
|
||||||
currentCluster is the current state fetched from kubernetes
|
currentCluster is the current state fetched from kubernetes
|
||||||
we add currentCluster certs to kubeCluster, kubeCluster would have the latest configuration from cluster.yaml and the certs to connect to k8s and apply the upgrade
|
we add currentCluster certs to kubeCluster, kubeCluster would have the latest configuration from cluster.yaml and the certs to connect to k8s and apply the upgrade
|
||||||
*/
|
*/
|
||||||
kubeCluster.Certificates = currentCluster.Certificates
|
kubeCluster.Certificates = currentCluster.Certificates
|
||||||
|
logrus.Debugf("Setting up upgrade tunnels")
|
||||||
err = kubeCluster.TunnelHosts()
|
err = kubeCluster.TunnelHosts()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return APIURL, caCrt, clientCert, clientKey, err
|
return APIURL, caCrt, clientCert, clientKey, err
|
||||||
|
Loading…
Reference in New Issue
Block a user