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
Brad Davidson 2025-02-26 21:15:47 +00:00
parent 0db300b1d7
commit fb75ee63b3
No known key found for this signature in database
GPG Key ID: FFB7A9376A9349B9
1 changed files with 4 additions and 0 deletions

View File

@ -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