fluxcd-flux2/pkg/bootstrap
Hidde Beydals 2ca3468423
Return error for public-only GPG signing keyring
`SelectOpenPGPSigningEntity` selects `keyRing[0]` when no key id is
supplied and then calls `entity.PrivateKey.Decrypt` directly. For a
keyring that contains only public keys — e.g. an armor-exported
public key file — `PrivateKey` is `nil` and the call panics with a
nil pointer dereference rather than surfacing an actionable error.
The keyed branch already guards against this; the default branch
did not.

Guard the default branch with the same nil check and return an
error pointing at `gpg --export-secret-keys` or `--gpg-key-id` so
the user knows how to recover. Cover the public-only-keyring case
in `TestSelectOpenPGPSigningEntity` so a future regression cannot
re-introduce the panic.

Assisted-by: claude/opus-4.7
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2026-06-19 15:03:54 +02:00
..
provider feat: add gitea bootstrapper 2023-11-01 15:46:42 +01:00
bootstrap.go Update CLI to OCIRepository v1 (GA) 2025-05-28 15:12:17 +03:00
bootstrap_plain_git.go Return error for public-only GPG signing keyring 2026-06-19 15:03:54 +02:00
bootstrap_provider.go Introduce visibility flag for bootstrap gitlab 2024-07-17 20:22:25 +02:00
bootstrap_test.go Return error for public-only GPG signing keyring 2026-06-19 15:03:54 +02:00
options.go Migrate bootstrap signing to generic Signer 2026-06-18 14:40:30 +02:00