From faf265e79b4ca2204001b0b9c3c1d52eadc1de92 Mon Sep 17 00:00:00 2001 From: Sanskar Jaiswal Date: Tue, 6 Jun 2023 18:42:51 +0530 Subject: [PATCH] check if GPG private key is nil before decrypting Signed-off-by: Sanskar Jaiswal --- internal/controller/imageupdateautomation_controller.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/controller/imageupdateautomation_controller.go b/internal/controller/imageupdateautomation_controller.go index b1b746ba..cf8b5516 100644 --- a/internal/controller/imageupdateautomation_controller.go +++ b/internal/controller/imageupdateautomation_controller.go @@ -574,7 +574,7 @@ func (r *ImageUpdateAutomationReconciler) getSigningEntity(ctx context.Context, } entity := entities[0] - if entity.PrivateKey.Encrypted { + if entity.PrivateKey != nil && entity.PrivateKey.Encrypted { passphrase, ok := secret.Data[signingPassphraseKey] if !ok { return nil, fmt.Errorf("can not use passphrase protected signing key without '%s' field present in secret %s",