Skip to content

Commit 337ace4

Browse files
Merge PR #2615: test(e2e): silence helm-template render in install-cozystack trace
2 parents 8846b5d + ddf7e5f commit 337ace4

1 file changed

Lines changed: 13 additions & 8 deletions

File tree

‎hack/e2e-install-cozystack.bats‎

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,22 @@
1818
# actually pulls (skips configmap fields and CRD examples that happen to
1919
# contain an `image:` key). Add a chart here when a new peer-sensitive
2020
# workload is found.
21-
# Capture each render into a variable first: bats does not enable
22-
# `pipefail`, so a `helm template` failure inside a brace-grouped pipe
23-
# would be silently masked by yq's exit code, the script would receive
24-
# empty stdin, and the test would pass while pre-pull was skipped.
25-
# Assigning to a variable lets `set -e` trigger on a render failure.
26-
kubeovn_manifests=$(helm template packages/system/kubeovn)
27-
linstor_manifests=$(helm template packages/system/linstor)
28-
printf '%s\n%s\n' "$kubeovn_manifests" "$linstor_manifests" | yq -N '
21+
# Stage each render to a file: bats does not enable `pipefail`, so a
22+
# direct `helm template | yq` pipe would let yq's exit code mask a
23+
# helm-template failure and the test would pass while pre-pull was
24+
# skipped. Writing to a file makes `set -e` trip on a render failure
25+
# without using `var=$(helm template ...)` captures, which `set -x`
26+
# would expand into the trace and balloon CI logs.
27+
local kubeovn_yaml linstor_yaml
28+
kubeovn_yaml=$(mktemp)
29+
linstor_yaml=$(mktemp)
30+
helm template packages/system/kubeovn > "$kubeovn_yaml"
31+
helm template packages/system/linstor > "$linstor_yaml"
32+
cat "$kubeovn_yaml" "$linstor_yaml" | yq -N '
2933
(..|select(has("containers"))|.containers[]|.image),
3034
(..|select(has("initContainers"))|.initContainers[]|.image)
3135
' | hack/e2e-prepull-images.sh
36+
rm -f "$kubeovn_yaml" "$linstor_yaml"
3237
}
3338

3439
@test "Install Cozystack" {

0 commit comments

Comments
 (0)