From d400c8e9e89d56caed845dd99a75b977e3cac35b Mon Sep 17 00:00:00 2001 From: Kingdon Barrett Date: Fri, 29 Oct 2021 09:59:32 -0400 Subject: [PATCH] Fix error during public key import MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit For signed commit verification, this code errors out on line 303: ✗ GitRepository reconciliation failed: ''PGP public keys secret error: expected pointer, but got nil Pointer was not initialized with a concrete instance of the Secret struct Signed-off-by: Kingdon Barrett --- controllers/gitrepository_controller.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/controllers/gitrepository_controller.go b/controllers/gitrepository_controller.go index 4da7d9ae1..be8a0a004 100644 --- a/controllers/gitrepository_controller.go +++ b/controllers/gitrepository_controller.go @@ -298,7 +298,7 @@ func (r *GitRepositoryReconciler) reconcile(ctx context.Context, repository sour Namespace: repository.Namespace, Name: repository.Spec.Verification.SecretRef.Name, } - var secret *corev1.Secret + secret := &corev1.Secret{} if err := r.Client.Get(ctx, publicKeySecret, secret); err != nil { err = fmt.Errorf("PGP public keys secret error: %w", err) return sourcev1.GitRepositoryNotReady(repository, sourcev1.VerificationFailedReason, err.Error()), err