-
Notifications
You must be signed in to change notification settings - Fork 593
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 attest with --key #2551
Fix attest with --key #2551
Conversation
Signed-off-by: Alex Goodman <[email protected]>
Signed-off-by: Will Murphy <[email protected]>
Signed-off-by: Will Murphy <[email protected]>
Signed-off-by: Will Murphy <[email protected]>
Signed-off-by: Will Murphy <[email protected]>
Signed-off-by: Will Murphy <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The setup looks correct given the changes in the shared CLI library. Did it work locally with an import/replace statement? I think the go mod in this PR isn't setup to pull the module from the branch so it's erroring saying no such module exists
@spiffcs - that's correct - a go.work file was used locally to test this. Once anchore/clio#37 is merged, I'll update this PR. It just makes sense to review them together, since it would be hard to see how the assertion and test application would be used in the clio PR. |
Signed-off-by: Will Murphy <[email protected]>
Fix passing "--key" to the attest command. Additionally, pull in an update to the clio CLI library to permit unit testing that flags and env vars are parsed to the correct field on command options structs. This testing strategy was needed here because testing attestation in an end to end test requires a prohibitive amount of setup. --------- Signed-off-by: Alex Goodman <[email protected]> Signed-off-by: Will Murphy <[email protected]> Co-authored-by: Alex Goodman <[email protected]>
Pull request adding a new testing pattern for CLIs, based on work over in clio: anchore/clio#37
Some feedback on this PR might inform anchore/clio#37, and this is meant to be merged after anchore/clio#37.
Fixes #2544 #2590
Testing
SYFT_ATTEST_PASSWORD
env var and--key
flag onattest
subcommand.SYFT_ATTEST_PASSWORD=<some-password> go run cmd/syft/main.go attest ghcr.io/willmurphyscode/test_image:latest --key ../scratch/empty/cosign.key
)