Skip to content

Commit

Permalink
Fix error during public key import
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
yebyen committed Oct 29, 2021
1 parent d3ea648 commit d400c8e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion controllers/gitrepository_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d400c8e

Please sign in to comment.