mirror of
https://github.com/rancher/rke.git
synced 2025-09-16 15:10:12 +00:00
Run rebuild cluster certs from clusterup
This commit is contained in:
committed by
Alena Prokharchyk
parent
918b4ad669
commit
3c6c7f1b7b
@@ -103,7 +103,6 @@ func doUpgradeLegacyCluster(ctx context.Context, kubeCluster *cluster.Cluster, f
|
||||
}
|
||||
|
||||
func ClusterUp(ctx context.Context, dialersOptions hosts.DialersOptions, flags cluster.ExternalFlags) (string, string, string, string, map[string]pki.CertificatePKI, error) {
|
||||
log.Infof(ctx, "Building Kubernetes cluster")
|
||||
var APIURL, caCrt, clientCert, clientKey string
|
||||
|
||||
clusterState, err := cluster.ReadStateFile(ctx, cluster.GetStateFilePath(flags.ClusterFilePath, flags.ConfigDir))
|
||||
@@ -115,7 +114,12 @@ func ClusterUp(ctx context.Context, dialersOptions hosts.DialersOptions, flags c
|
||||
if err != nil {
|
||||
return APIURL, caCrt, clientCert, clientKey, nil, err
|
||||
}
|
||||
// check if rotate certificates is triggered
|
||||
if kubeCluster.RancherKubernetesEngineConfig.RotateCertificates != nil {
|
||||
return rebuildClusterWithRotatedCertificates(ctx, dialersOptions, flags)
|
||||
}
|
||||
|
||||
log.Infof(ctx, "Building Kubernetes cluster")
|
||||
err = kubeCluster.SetupDialers(ctx, dialersOptions)
|
||||
if err != nil {
|
||||
return APIURL, caCrt, clientCert, clientKey, nil, err
|
||||
|
Reference in New Issue
Block a user