mirror of https://github.com/k3s-io/k3s.git
Fix panic when secret-encrypt status is checked before runtime core is ready
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit e7b52cd63d
)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
pull/11931/head
parent
0db300b1d7
commit
fb75ee63b3
|
@ -79,6 +79,10 @@ func EncryptionStatus(control *config.Control) http.Handler {
|
|||
|
||||
func encryptionStatus(control *config.Control) (EncryptionState, error) {
|
||||
state := EncryptionState{}
|
||||
if control.Runtime.Core == nil {
|
||||
return state, util.ErrCoreNotReady
|
||||
}
|
||||
|
||||
providers, err := secretsencrypt.GetEncryptionProviders(control.Runtime)
|
||||
if os.IsNotExist(err) {
|
||||
return state, nil
|
||||
|
|
Loading…
Reference in New Issue