From 787052a9756456239e5d144588e45f2827ccd491 Mon Sep 17 00:00:00 2001 From: "Kabanov, Dmitrii" Date: Tue, 11 Aug 2020 20:31:31 -0700 Subject: [PATCH] [ceph-osd] update post apply job The PS updates post apply job and moves execution of the command outside of if statement. The output of the command stored in a variable which will be checked in if statement. Added "-z" to correct comparison of the length of the string (variable). It was accidentally missed in the initial PS. Change-Id: I907f75d0a9e5ef27fba5306ddb86199e94b01b3b --- ceph-osd/templates/bin/_post-apply.sh.tpl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ceph-osd/templates/bin/_post-apply.sh.tpl b/ceph-osd/templates/bin/_post-apply.sh.tpl index 5a405c4531..03a21f18a3 100644 --- a/ceph-osd/templates/bin/_post-apply.sh.tpl +++ b/ceph-osd/templates/bin/_post-apply.sh.tpl @@ -41,7 +41,8 @@ function wait_for_pods() { select="select((.status) or (.phase==\"Succeeded\") | not)" query=".items | map( ${fields} | ${select}) | .[]" while true; do - if [[ $(kubectl get pods --namespace="${1}" -o json | jq -c "${query}") ]]; then + unhealthy_pods=$(kubectl get pods --namespace="${1}" -o json | jq -c "${query}") + if [[ -z "${unhealthy_pods}" ]]; then break fi sleep 5