mirror of
https://git.vectorsigma.ru/public/k3s.git
synced 2026-07-29 00:19:36 +00:00
Fix secretsencryption request handler panic
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
This commit is contained in:
committed by
Brad Davidson
parent
cb889d41f2
commit
0dd6f17797
@@ -192,6 +192,12 @@ func EncryptionConfig(ctx context.Context, control *config.Control) http.Handler
|
||||
util.SendError(fmt.Errorf("method not allowed"), resp, req, http.StatusMethodNotAllowed)
|
||||
return
|
||||
}
|
||||
|
||||
if control.Runtime.Core == nil {
|
||||
util.SendError(util.ErrCoreNotReady, resp, req, http.StatusServiceUnavailable)
|
||||
return
|
||||
}
|
||||
|
||||
encryptReq, err := getEncryptionRequest(req)
|
||||
if err != nil {
|
||||
util.SendError(err, resp, req, http.StatusBadRequest)
|
||||
|
||||
Reference in New Issue
Block a user