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 wait-for-image polluting stdout #18

Merged
merged 2 commits into from
Aug 10, 2023
Merged

Conversation

vikin91
Copy link
Contributor

@vikin91 vikin91 commented Aug 10, 2023

In this version calling gh_log does not pollute the stdout and curl can pass the data to jq.

@vikin91 vikin91 marked this pull request as ready for review August 10, 2023 10:44
@vikin91 vikin91 changed the title Fix wait-for-image Fix wait-for-image polluting stdout Aug 10, 2023
} | jq -r ".tags[0].name"
CURL_PARAMS+=( "--silent" "--show-error" "--fail" "--location" "$URL" )
if [ -n "$QUAY_TOKEN" ]; then
>&2 gh_log notice "Connecting to Quay with token"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is the stderr redirect necessary now that you run curl | jq outside the block?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, as we later use the output of find_tag. This means that stdout must be clean

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Without >&2:

$ CI=false GITHUB_STEP_SUMMARY="a" ./release/wait-for-image/wait-for-image.sh stackrox-io/main:4.1.1                                                                   
Waiting 30 more seconds for stackrox-io/main:4.1.1...

With >&2:

$  CI=false GITHUB_STEP_SUMMARY="a" ./release/wait-for-image/wait-for-image.sh stackrox-io/main:4.1.1 
::notice::Connecting to Quay without token
::notice::Image 'stackrox-io/main:4.1.1' has been found on Quay.io.

@vikin91 vikin91 merged commit 5316bd7 into main Aug 10, 2023
@vikin91 vikin91 deleted the piotr/fix-wait-for-image branch August 10, 2023 11:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants