diff --git a/infrastructure/longhorn/core/longhorn-csi-toleration-ensure-job.yaml b/infrastructure/longhorn/core/longhorn-csi-toleration-ensure-job.yaml index 52089912..44f9f875 100644 --- a/infrastructure/longhorn/core/longhorn-csi-toleration-ensure-job.yaml +++ b/infrastructure/longhorn/core/longhorn-csi-toleration-ensure-job.yaml @@ -2,7 +2,7 @@ apiVersion: batch/v1 kind: Job metadata: - name: longhorn-csi-toleration-ensure-2 + name: longhorn-csi-toleration-ensure-3 namespace: longhorn-system spec: backoffLimit: 0 @@ -64,4 +64,13 @@ spec: kubectl -n "${ns}" patch daemonset "${ds}" --type=merge -p "${patch}" fi - kubectl -n "${ns}" rollout status daemonset/"${ds}" --timeout=180s + for attempt in $(seq 1 90); do + if kubectl get csinode titan-23 -o json | jq -e '.spec.drivers[]? | select(.name == "driver.longhorn.io")' >/dev/null; then + echo "driver.longhorn.io registered on titan-23" + exit 0 + fi + sleep 2 + done + + echo "driver.longhorn.io did not register on titan-23 before timeout" >&2 + exit 1