Skip to content

Commit d742a10

Browse files
committed
BATS: helm-install-rancher: wait for Available instead of helm --wait
The rancher Deployment uses the default `progressDeadlineSeconds` (10m), which is shorter than the initial `rancher/rancher` image pull (~487 MB) on slow networks (notably WSL2 on Windows). When that deadline lapses, Kubernetes marks the Deployment Failed with `ProgressDeadlineExceeded`; `helm --wait` reads that condition and bails out before its own `--timeout` would have allowed the pull to complete. Drop `helm --wait` and wait on `Available` directly with `kubectl wait --for=condition=Available --timeout=30m`. `Available` is driven by Ready replica count and is unaffected by `ProgressDeadlineExceeded`, so once the pull eventually completes and the pod goes Ready the wait succeeds. Also `--set replicas=1` since this is a single-node cluster — running three Rancher replicas adds no test coverage and consumes scarce VM memory. Signed-off-by: Jan Dubois <jan.dubois@suse.com>
1 parent 4e994f1 commit d742a10

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

bats/tests/k8s/helm-install-rancher.bats

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,17 @@ deploy_rancher() {
112112
--version "$rancher_chart_version" \
113113
--namespace cattle-system \
114114
--set hostname="$host" \
115-
--wait \
116-
--timeout=10m \
115+
--set replicas=1 \
117116
--create-namespace
117+
118+
# Don't use `helm --wait`: the chart's Deployment relies on the default
119+
# `progressDeadlineSeconds` (10m), which is shorter than the initial
120+
# rancher image pull on slow networks. Wait on `Available` directly,
121+
# since that condition is driven by pod Ready state and is unaffected
122+
# by ProgressDeadlineExceeded.
123+
kubectl wait --namespace cattle-system \
124+
--for=condition=Available --timeout=30m \
125+
deployment/rancher
118126
}
119127

120128
verify_rancher() {

0 commit comments

Comments
 (0)