Skip to content

fix(velero): avoid broken pipe in cron-velero-update generate.sh - #6113

Open
xavpaice wants to merge 1 commit into
mainfrom
fix-cron-velero-update-pipe
Open

fix(velero): avoid broken pipe in cron-velero-update generate.sh#6113
xavpaice wants to merge 1 commit into
mainfrom
fix-cron-velero-update-pipe

Conversation

@xavpaice

Copy link
Copy Markdown
Member

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.sh runs with set -euo pipefail and used:

version=$(curl -fsSL "$url" | grep -m1 '"name": "v' | grep -Eo ...)

grep -m1 exits after the first match, closing the pipe before curl is done writing. With pipefail enabled, curl exits 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.sh runs end-to-end, including the Docker/Skopeo tag lookup:

Found velero version 1.18.2
Found plugins AWS 1.14.2 AZURE 1.14.2 GCP 1.14.2
Found kurlsh/s3cmd tag 20260825-a9ea1c6

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.
@xavpaice
xavpaice requested a review from a team as a code owner August 28, 2026 02:28
@greptile-apps

greptile-apps Bot commented Aug 28, 2026

Copy link
Copy Markdown

Reviews (1): Last reviewed commit: "fix(velero): avoid broken pipe in cron-v..." | Re-trigger Greptile

@xavpaice

Copy link
Copy Markdown
Member Author

@kriscoleman kriscoleman left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

:shipit:

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