Skip to content

Commit

Permalink
Fix panic when secret-encrypt status is checked before runtime core i…
Browse files Browse the repository at this point in the history
…s ready

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
  • Loading branch information
brandond committed Feb 27, 2025
1 parent f940368 commit e7b52cd
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/server/handlers/secrets-encrypt.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e7b52cd

Please # to comment.