mirror of
https://github.com/rancher/rke.git
synced 2025-06-21 13:07:08 +00:00
Merge pull request #2596 from chaudhryfaisal/CustomCertsEncryptionConfig
set EncryptionConfig on DesiredState when using CustomCerts
This commit is contained in:
commit
0650395889
@ -182,6 +182,11 @@ func RebuildState(ctx context.Context, kubeCluster *Cluster, oldState *FullState
|
|||||||
}
|
}
|
||||||
newState.DesiredState.CertificatesBundle = certBundle
|
newState.DesiredState.CertificatesBundle = certBundle
|
||||||
newState.CurrentState = oldState.CurrentState
|
newState.CurrentState = oldState.CurrentState
|
||||||
|
|
||||||
|
err = updateEncryptionConfig(kubeCluster, oldState, newState)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
return newState, nil
|
return newState, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -341,7 +346,12 @@ func rebuildExistingState(ctx context.Context, kubeCluster *Cluster, oldState, n
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
newState.DesiredState.CertificatesBundle = pkiCertBundle
|
newState.DesiredState.CertificatesBundle = pkiCertBundle
|
||||||
if isEncryptionEnabled(rkeConfig) {
|
err := updateEncryptionConfig(kubeCluster, oldState, newState)
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
func updateEncryptionConfig(kubeCluster *Cluster, oldState *FullState, newState *FullState) error {
|
||||||
|
if isEncryptionEnabled(&kubeCluster.RancherKubernetesEngineConfig) {
|
||||||
if oldState.DesiredState.EncryptionConfig != "" {
|
if oldState.DesiredState.EncryptionConfig != "" {
|
||||||
newState.DesiredState.EncryptionConfig = oldState.DesiredState.EncryptionConfig
|
newState.DesiredState.EncryptionConfig = oldState.DesiredState.EncryptionConfig
|
||||||
} else {
|
} else {
|
||||||
@ -351,6 +361,5 @@ func rebuildExistingState(ctx context.Context, kubeCluster *Cluster, oldState, n
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user