Skip to content

Commit cd28f71

Browse files
chore(cozyreport): switch summary script to bash for unconditional pipefail
Verified that the e2e-sandbox image's /bin/sh is Ubuntu's dash (0.5.11 on 22.04, 0.5.12 on 24.04) and neither build implements `set -o pipefail`. Rather than guarding the option with `|| true` (which silently drops the very behaviour we want) or rebasing the sandbox onto a different /bin/sh (high-cost image rebuild + ghcr push for one script), point the shebang at /bin/bash, which is already installed in the image and supports pipefail unconditionally. cozyreport.sh stays /bin/sh — it does not need pipefail. Signed-off-by: Myasnikov Daniil <[email protected]>
1 parent 2b10c28 commit cd28f71

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

‎hack/cozyreport-summary.sh‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
#!/bin/sh
1+
#!/bin/bash
22
# Emit a human-readable summary of "what is broken" to a single file.
33
# Reads the live cluster (not the report dir) so it can use kubectl JSONPath.
44
# Usage: cozyreport-summary.sh > summary.txt
5-
set -eu
6-
# pipefail surfaces a failed kubectl in `kubectl ... | awk ...` chains as a
7-
# missing section instead of a silently-empty one. POSIX sh does not
8-
# guarantee `set -o pipefail`, but every shell cozystack ships with (dash,
9-
# bash, busybox ash) supports it; the call site wraps this script in
10-
# `|| true` so a hard exit here still produces a (truncated) summary.txt.
11-
set -o pipefail 2>/dev/null || true
5+
#
6+
# bash, not /bin/sh: we rely on `set -o pipefail` to surface failed kubectl
7+
# calls in `kubectl ... | awk ...` chains as missing sections instead of
8+
# silently-empty ones, and the e2e-sandbox image's /bin/sh (Ubuntu dash)
9+
# does not implement pipefail. The call site wraps this script in `|| true`
10+
# so a hard pipeline failure still produces a (truncated) summary.txt.
11+
set -euo pipefail
1212

1313
echo "# Cozystack E2E Diagnostic Summary"
1414
echo "Generated: $(date -Iseconds)"

0 commit comments

Comments
 (0)