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