1
0
mirror of https://github.com/rancher/rke.git synced 2025-08-31 14:36:32 +00:00

Handle missing request header ca in rotate certificate

This commit is contained in:
galal-hussein
2019-08-29 20:59:47 +02:00
committed by Alena Prokharchyk
parent a569f2e81c
commit 798632b3a4
3 changed files with 25 additions and 7 deletions

View File

@@ -184,6 +184,12 @@ func RotateRKECertificates(ctx context.Context, c *Cluster, flags ExternalFlags,
if c.Certificates[pki.ServiceAccountTokenKeyName].Key != nil {
serviceAccountTokenKey = string(cert.EncodePrivateKeyPEM(c.Certificates[pki.ServiceAccountTokenKeyName].Key))
}
// check for legacy clusters prior to requestheaderca
if c.Certificates[pki.RequestHeaderCACertName].Certificate == nil {
if err := pki.GenerateRKERequestHeaderCACert(ctx, c.Certificates, flags.ClusterFilePath, flags.ConfigDir); err != nil {
return err
}
}
if err := pki.GenerateRKEServicesCerts(ctx, c.Certificates, c.RancherKubernetesEngineConfig, flags.ClusterFilePath, flags.ConfigDir, true); err != nil {
return err
}