From 37af8f192ea6f974839f5b354a72259546689c2d Mon Sep 17 00:00:00 2001 From: Xav Paice Date: Fri, 28 Aug 2026 14:27:48 +1200 Subject: [PATCH] fix(velero): avoid broken pipe in cron-velero-update generate.sh 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. --- addons/velero/template/generate.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/addons/velero/template/generate.sh b/addons/velero/template/generate.sh index cb92162e1d..5db3150699 100755 --- a/addons/velero/template/generate.sh +++ b/addons/velero/template/generate.sh @@ -17,10 +17,15 @@ function get_latest_release_version() { function get_latest_tag_version() { VAR_NAME=$1 local url=$2 + local response local version - version=$(curl -fsSL "$url" | \ - grep -m1 '"name": "v' | \ + # Fetch the full response before grepping. Under set -o pipefail, piping + # curl directly to grep -m1 can fail with exit code 23 when grep exits + # after the first match and closes the pipe. Using a here-string avoids + # the broken-pipe issue entirely. + response=$(curl -fsSL "$url") + version=$(grep -m1 '"name": "v' <<< "$response" | \ grep -Eo "[0-9]+\.[0-9]+\.[0-9]+") export "$VAR_NAME=$version"