mirror of
https://github.com/rancher/rke.git
synced 2025-09-19 18:30:38 +00:00
Fix race condition
This commit is contained in:
@@ -77,6 +77,11 @@ func ClusterUp(clusterFile string) (string, string, string, string, error) {
|
|||||||
return APIURL, caCrt, clientCert, clientKey, err
|
return APIURL, caCrt, clientCert, clientKey, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
err = kubeCluster.SaveClusterState(clusterFile)
|
||||||
|
if err != nil {
|
||||||
|
return APIURL, caCrt, clientCert, clientKey, err
|
||||||
|
}
|
||||||
|
|
||||||
err = kubeCluster.DeployNetworkPlugin()
|
err = kubeCluster.DeployNetworkPlugin()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return APIURL, caCrt, clientCert, clientKey, err
|
return APIURL, caCrt, clientCert, clientKey, err
|
||||||
@@ -87,10 +92,6 @@ func ClusterUp(clusterFile string) (string, string, string, string, error) {
|
|||||||
return APIURL, caCrt, clientCert, clientKey, err
|
return APIURL, caCrt, clientCert, clientKey, err
|
||||||
}
|
}
|
||||||
|
|
||||||
err = kubeCluster.SaveClusterState(clusterFile)
|
|
||||||
if err != nil {
|
|
||||||
return APIURL, caCrt, clientCert, clientKey, err
|
|
||||||
}
|
|
||||||
APIURL = fmt.Sprintf("https://" + kubeCluster.ControlPlaneHosts[0].IP + ":6443")
|
APIURL = fmt.Sprintf("https://" + kubeCluster.ControlPlaneHosts[0].IP + ":6443")
|
||||||
caCrt = string(cert.EncodeCertPEM(kubeCluster.Certificates[pki.CACertName].Certificate))
|
caCrt = string(cert.EncodeCertPEM(kubeCluster.Certificates[pki.CACertName].Certificate))
|
||||||
clientCert = string(cert.EncodeCertPEM(kubeCluster.Certificates[pki.KubeAdminCommonName].Certificate))
|
clientCert = string(cert.EncodeCertPEM(kubeCluster.Certificates[pki.KubeAdminCommonName].Certificate))
|
||||||
|
Reference in New Issue
Block a user