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

ci: add retry to cosign keyless test #1109

Merged
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions plugins/verifier/cosign/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ $ ratify verify --config ~/.ratify/config.json --subject myregistry.io/example/h
## Keyless Verification
This section outlines how to use `ratify` to verify the signatures signed using keyless signatures.

> [!WARNING]
> Cosign keyless verification may result in verification timeout due to Fulcio and Rekor server latencies

### Configuration

```json
Expand Down
1 change: 1 addition & 0 deletions test/bats/helpers.bash
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ wait_for_process() {
return 0
else
sleep "$sleep_time"
echo "# retrying $cmd" >&3
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

curious what's FD 3?

Copy link
Collaborator Author

@akashsinghal akashsinghal Oct 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This the FD for the TAP stream produced by BATS. The TAP stream is always outputted to the console regardless of success or failure. I think it might be helpful to see if retries were for a success and not just a failure. https://bats-core.readthedocs.io/en/stable/writing-tests.html#printing-to-the-terminal

wait_time=$((wait_time - sleep_time))
fi
done
Expand Down
3 changes: 1 addition & 2 deletions test/bats/plugin-test.bats
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,7 @@ SLEEP_TIME=1
run kubectl replace -f ./config/samples/config_v1beta1_store_oras.yaml
sleep 5

run kubectl run cosign-demo-keyless --namespace default --image=wabbitnetworks.azurecr.io/test/cosign-image:signed-keyless
assert_success
wait_for_process 20 10 'kubectl run cosign-demo-keyless --namespace default --image=wabbitnetworks.azurecr.io/test/cosign-image:signed-keyless'
akashsinghal marked this conversation as resolved.
Show resolved Hide resolved
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

consider adding a retry message with outputs of the command

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

consider updating the cosign verifier docs to mention potential timeout

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added note to the cosign doc. This doc should probably be migrated to the website.

added a retry statement with the command that gets outputed to a separate IO stream that is always printed. see docs: https://bats-core.readthedocs.io/en/stable/writing-tests.html#printing-to-the-terminal

}

@test "licensechecker test" {
Expand Down
Loading