-
Notifications
You must be signed in to change notification settings - Fork 58
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
feat(CLOUDDST-25034): run rh-sign-image-cosign signing in paralles (FIXED) #771
base: development
Are you sure you want to change the base?
feat(CLOUDDST-25034): run rh-sign-image-cosign signing in paralles (FIXED) #771
Conversation
Hi @midnightercz. Thanks for your PR. I'm waiting for a konflux-ci member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
3edf95a
to
a54fd80
Compare
/ok-to-test |
@@ -147,7 +148,8 @@ spec: | |||
fi | |||
|
|||
if [ "$found_signatures" -eq 0 ]; then | |||
run_cosign -t 3m0s sign "$COSIGN_REKOR_ARGS" \ | |||
# shellcheck disable=SC2086 |
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.
I would suggest to use an array for the args and then this won't be needed. See my other comment.
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.
fixed
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.
It's not correct right now. An array needs to be used. Right now it's just one big string.
COSIGN_REKOR_ARGS="--insecure-ignore-tlog=true" | ||
fi | ||
# shellcheck disable=SC2086 | ||
verify_output=$(run_cosign verify $COSIGN_REKOR_ARGS --key "$PUBLIC_KEY_FILE" "$reference") |
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.
When running cosign verify locally, I had to download public key of rekor and set SIGSTORE_REKOR_PUBLIC_KEY with it. Otherwise, it fails with "Error: no matching signatures: error verifying bundle: verifying bundle: rekor log public key not found for payload". Does it need to be set here?
local reference=$2 | ||
local tag=$3 | ||
local digest=$4 | ||
found_signatures=$(check_existing_signatures "$identity" "$reference:$tag" "$digest") |
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.
Verifying tag reference can only get signature of the manifest list. Manifest digests would always have 0 found signatures. Verify reference@digest instead?
Parallel runs of the same image may result in some signatures not pushed. A reproducer:
We've met this in pubtools-sign release-engineering/pubtools-sign#37 (comment). |
5aa7d15
to
40856f8
Compare
fi | ||
|
||
if [ "$found_signatures" -eq 0 ]; then | ||
run_cosign -t 3m0s sign "${COSIGN_REKOR_ARGS[@]}" \ |
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.
$ COSIGN_REKOR_ARGS="-y --rekor-url=abc"; cosign sign "${COSIGN_REKOR_ARGS[@]}"
WARNING: the -y --rekor-url=abc flag is deprecated and will be removed in a future release. Please use the --y --rekor-url=abc flag instead.
Error: unknown flag: --y --rekor-url
main.go:74: error during command execution: unknown flag: --y --rekor-url
Remove the quotes?
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 quotes were used because otherwise shellcheck complains.
But as I suggested in #771 (comment) , an array should be used. Currently COSIGN_REKOR_ARGS is defined as a plain string. See here for an example: https://github.com/konflux-ci/release-service-catalog/blob/development/tasks/managed/create-pyxis-image/create-pyxis-image.yaml#L165
/ok-to-test |
@midnightercz: The following test has Failed, say /retest to rerun failed tests.
Inspecting Test ArtifactsTo inspect your test artifacts, follow these steps:
mkdir -p oras-artifacts
cd oras-artifacts
oras pull quay.io/konflux-test-storage/konflux-team/release-service-catalog:konflux-e2e-tests-catalog-b6wf8 Test results analysis🚨 Error occurred while running the E2E tests, list of failed Spec(s): ➡️ [ Click to view logsPipelineRun managed-nk8pb failed Expected : Pipelinerun 'managed-nk8pb' didn't succeed\n to equal : ➡️ [ Click to view logsPipelineRun managed-rs8dx failed Expected : Pipelinerun 'managed-rs8dx' didn't succeed\n to equal : ➡️ [ Click to view logsPipelineRun managed-7b5vz failed Expected : Pipelinerun 'managed-7b5vz' didn't succeed\n to equal : ➡️ [ Click to view logsTimed out after 600.088s. Expected success, but got an error: <*errors.errorString | 0xc0005e9c10>: The reference is not updated and the source PR#1808 is not added to the PR of infra-deployments { s: "The reference is not updated and the source PR#1808 is not added to the PR of infra-deployments", } |
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.
No comments from me beyond the open threads
rh-sign-image-cosign now checks for existing signatures and sign only when signature for given identity and digest is not found. Also whole procedure now runs in parallel. Signed-off-by: Jindrich Luza <[email protected]>
- Added missing --key "$PUBLIC_KEY_FILE" to cosign verify calls - Removed string wrap from COSIGN_REKOR_ARGS Signed-off-by: Jindrich Luza <[email protected]>
- export SIGSTORE_REKOR_PUBLIC_KEY for verification - fixed bash array argument Signed-off-by: Jindrich Luza <[email protected]>
18d4b00
to
332dde2
Compare
Verify images by digest not tag Signed-off-by: Jindrich Luza <[email protected]>
332dde2
to
71a8311
Compare
rh-sign-image-cosign now checks for existing signatures and sign only when signature for given identity and digest is not found. Also whole procedure now runs in parallel.
This includes fixed reported by user in the second commit