Skip to content

Commit f269e63

Browse files
test(e2e): fail where the baseline capture fails, not where it is read
The seed side carried the same fail-open the platform verify just lost: `kubectl get pods -A | awk ... > file || true` takes the exit status of the pipeline's LAST command, and the `|| true` discarded even that. A failed listing therefore wrote an EMPTY baseline and passed. An empty baseline is not silent — verify/platform reads every currently-unbound PV as newly unbound — but it fails forty minutes later, in the wrong suite, naming resources that were unbound before the upgrade ever started. Take both listings out of their pipelines so `set -e` sees them, and drop the `2>/dev/null` that was hiding the reason. The two intermediates go to /tmp rather than the baseline directory, so what the verify phase reads there is still exactly the two snapshots this suite documents. Assisted-By: Claude <[email protected]> Signed-off-by: Myasnikov Daniil <[email protected]>
1 parent fe40b2b commit f269e63

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

‎hack/e2e-chainsaw-upgrade/seed/zz-baseline/chainsaw-test.yaml‎

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,16 @@ spec:
2424
set -eu
2525
dir=/workspace/_out/upgrade-baseline
2626
mkdir -p "$dir"
27-
kubectl get pods -A --no-headers 2>/dev/null \
28-
| awk '/CrashLoopBackOff/ {print $1"/"$2}' | sort > "$dir/crashloop.txt" || true
29-
kubectl get pv --no-headers 2>/dev/null \
30-
| awk '$5 != "Bound" {print $1}' | sort > "$dir/unbound-pv.txt" || true
27+
# Both listings go through a file, and neither swallows an error. A
28+
# pipeline takes the exit status of its LAST command, and `|| true`
29+
# discarded even that, so a failed `kubectl get` left an EMPTY
30+
# baseline: verify/platform would then read every currently-unbound PV
31+
# as newly unbound and fail forty minutes later, naming the wrong
32+
# thing. Fail here, where the error is.
33+
kubectl get pods -A --no-headers > /tmp/seed-pods-raw.txt
34+
awk '/CrashLoopBackOff/ {print $1"/"$2}' /tmp/seed-pods-raw.txt | sort > "$dir/crashloop.txt"
35+
kubectl get pv --no-headers > /tmp/seed-pv-raw.txt
36+
awk '$5 != "Bound" {print $1}' /tmp/seed-pv-raw.txt | sort > "$dir/unbound-pv.txt"
3137
echo "=== pre-upgrade CrashLoopBackOff pods ==="; cat "$dir/crashloop.txt"
3238
echo "=== pre-upgrade unbound PVs ==="; cat "$dir/unbound-pv.txt"
3339
check:

0 commit comments

Comments
 (0)