fix(e2e): wait for LINSTOR HelmRelease Ready before polling its deployment

The previous 5-min timeout on `until kubectl get deploy/linstor-controller`
fired during cold-install runs where the LINSTOR HR's dependency chain
(cert-manager → piraeus-operator-crds → piraeus-operator → linstor)
takes longer than 5 min to resolve, killing the whole post-install-prep
script via `set -eu`. With CI's 3x retry the failure was hidden; with the
retry removed it would surface every cold install.

Wait on the LINSTOR HR being Ready first (the actual prerequisite),
then keep the existence-poll as a near-instant backstop, then wait
for Available. Same final semantics, no fragile fixed-window timeout.

Surfaced by PR #2500 cozyreport diagnostics (post-install-prep.log).

Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
This commit is contained in:
Myasnikov Daniil 2026-04-27 23:10:16 +05:00
parent 4ee073e2bb
commit eb87413556
No known key found for this signature in database
GPG key ID: FA953A439C637F04

View file

@ -5,6 +5,12 @@
# overlaps with the wait instead of compounding it.
set -eu
echo "[post-install-prep] waiting for linstor HelmRelease object to exist"
timeout 60 sh -ec 'until kubectl get hr/linstor -n cozy-linstor >/dev/null 2>&1; do sleep 2; done'
echo "[post-install-prep] waiting for linstor HelmRelease to be Ready"
kubectl wait helmrelease/linstor -n cozy-linstor --for=condition=Ready --timeout=15m
echo "[post-install-prep] waiting for linstor-controller deployment to exist"
timeout 300 sh -ec 'until kubectl get deploy/linstor-controller -n cozy-linstor >/dev/null 2>&1; do sleep 2; done'