Confir what argo is watching

This commit is contained in:
juvenal.diaz 2026-07-22 23:31:10 -06:00
parent 005a3c4b84
commit 6277dfb5d2
1 changed files with 10 additions and 0 deletions

10
jeannie
View File

@ -3656,6 +3656,16 @@ wait_for_cluster_resource() {
local app="$3" local app="$3"
local timeout_seconds="$4" local timeout_seconds="$4"
local elapsed=0 local elapsed=0
local api_resource
api_resource="${kind%%/*}"
if ! kubectl --kubeconfig "${KUBECONFIG}" get crd "${api_resource}" >/dev/null 2>&1; then
echo "Required CRD ${api_resource} is not installed; cannot wait for ${kind}/${name} from Argo CD app ${app}." >&2
kubectl --kubeconfig "${KUBECONFIG}" -n argocd get application "${app}" \
-o jsonpath='sync={.status.sync.status} health={.status.health.status} message={.status.operationState.message}{"\n"}' 2>/dev/null || true
dump_argocd_debug "${app}"
exit 1
fi
until kubectl --kubeconfig "${KUBECONFIG}" get "${kind}/${name}" >/dev/null 2>&1; do until kubectl --kubeconfig "${KUBECONFIG}" get "${kind}/${name}" >/dev/null 2>&1; do
if ((elapsed >= timeout_seconds)); then if ((elapsed >= timeout_seconds)); then