|
18 | 18 | # actually pulls (skips configmap fields and CRD examples that happen to |
19 | 19 | # contain an `image:` key). Add a chart here when a new peer-sensitive |
20 | 20 | # 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 ' |
29 | 33 | (..|select(has("containers"))|.containers[]|.image), |
30 | 34 | (..|select(has("initContainers"))|.initContainers[]|.image) |
31 | 35 | ' | hack/e2e-prepull-images.sh |
| 36 | + rm -f "$kubeovn_yaml" "$linstor_yaml" |
32 | 37 | } |
33 | 38 |
|
34 | 39 | @test "Install Cozystack" { |
|
0 commit comments