Fix panic when secret-encrypt status is checked before runtime core is ready

Signed-off-by: 's avatarBrad Davidson <brad.davidson@rancher.com> (cherry picked from commit e7b52cd6) Signed-off-by: 's avatarBrad Davidson <brad.davidson@rancher.com>
parent 0db300b1
...@@ -79,6 +79,10 @@ func EncryptionStatus(control *config.Control) http.Handler { ...@@ -79,6 +79,10 @@ func EncryptionStatus(control *config.Control) http.Handler {
func encryptionStatus(control *config.Control) (EncryptionState, error) { func encryptionStatus(control *config.Control) (EncryptionState, error) {
state := EncryptionState{} state := EncryptionState{}
if control.Runtime.Core == nil {
return state, util.ErrCoreNotReady
}
providers, err := secretsencrypt.GetEncryptionProviders(control.Runtime) providers, err := secretsencrypt.GetEncryptionProviders(control.Runtime)
if os.IsNotExist(err) { if os.IsNotExist(err) {
return state, nil return state, nil
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment