fix(velero): avoid broken pipe in cron-velero-update generate.sh - #6113
Open
xavpaice wants to merge 1 commit into
Open
fix(velero): avoid broken pipe in cron-velero-update generate.sh#6113xavpaice wants to merge 1 commit into
xavpaice wants to merge 1 commit into
Conversation
The cron-velero-update workflow was failing with exit code 23 during the Create Velero Update step. Under set -o pipefail, piping curl directly to grep -m1 caused curl to fail when grep closed the pipe after the first match. Fetch the GitHub tags response into a variable and use a here-string to grep it, avoiding the broken pipe entirely.
|
Reviews (1): Last reviewed commit: "fix(velero): avoid broken pipe in cron-v..." | Re-trigger Greptile |
Member
Author
|
Run with this change: https://github.com/replicatedhq/kURL/actions/runs/33136111663/job/98736349611 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes the recurring failure in the cron-velero-update workflow (e.g. run https://github.com/replicatedhq/kURL/actions/runs/32679945073).
Problem
The "Create Velero Update" step failed with exit code 23 because
generate.shruns withset -euo pipefailand used:version=$(curl -fsSL "$url" | grep -m1 '"name": "v' | grep -Eo ...)grep -m1exits after the first match, closing the pipe beforecurlis done writing. Withpipefailenabled,curlexits with code 23 (failed writing body) and aborts the step.Fix
Fetch the full GitHub tags response into a variable first, then use a here-string to grep it, avoiding the broken pipe.
Verification
Reproduced the failure in an Ubuntu 24.04 container (the same runner image) and confirmed the fixed
generate.shruns end-to-end, including the Docker/Skopeo tag lookup: