Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix pointer error during public key import #479

Merged
merged 1 commit into from
Oct 29, 2021

Conversation

kingdonb
Copy link
Member

When testing the signed commit verification feature that is documented, we noticed this code errors out on line 303:

PGP public keys secret error: expected pointer, but got nil

Looks like the pointer was not initialized with a concrete instance of the Secret struct, so this code fails.

I have manually verified this change enables commit verification, and that unsigned commits (or missing pgp keys) fail in expected ways now:

flux-system           	False	PGP public keys secret error: Secret "pgp-public-keys" not found

or

flux-system           	False	commit does not have a PGP signature                                          	main/27187bea606c0da16ff1555394a0ff9d68a33595

(both of these are expected failures)

We suspect that changes in controller-runtime are the culprit, this must have worked at the time it was added. (Might be good to cover it with a test, if it turns out we don't have one!)

Thanks to @citadelcore for bringing this to my attention!

@kingdonb
Copy link
Member Author

A reference back to the Slack thread where this issue was revealed:
https://cloud-native.slack.com/archives/CLAJ40HV3/p1635514366442700

@hiddeco hiddeco added area/git Git related issues and pull requests bug Something isn't working labels Oct 29, 2021
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 <yebyen@gmail.com>
@kingdonb
Copy link
Member Author

I updated the PR per your suggestion @hiddeco thanks!

@hiddeco hiddeco merged commit 14cb2a7 into fluxcd:main Oct 29, 2021
@kingdonb kingdonb deleted the fix-commit-verification branch October 30, 2021 15:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/git Git related issues and pull requests bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants