Skip to content

Commit d400c8e

Browse files
committed
Fix error during public key import
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 <[email protected]>
1 parent d3ea648 commit d400c8e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

controllers/gitrepository_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ func (r *GitRepositoryReconciler) reconcile(ctx context.Context, repository sour
298298
Namespace: repository.Namespace,
299299
Name: repository.Spec.Verification.SecretRef.Name,
300300
}
301-
var secret *corev1.Secret
301+
secret := &corev1.Secret{}
302302
if err := r.Client.Get(ctx, publicKeySecret, secret); err != nil {
303303
err = fmt.Errorf("PGP public keys secret error: %w", err)
304304
return sourcev1.GitRepositoryNotReady(repository, sourcev1.VerificationFailedReason, err.Error()), err

0 commit comments

Comments
 (0)