diff --git a/deploy/gk-deploy b/deploy/gk-deploy index 8cf5b40e..bded549f 100755 --- a/deploy/gk-deploy +++ b/deploy/gk-deploy @@ -916,7 +916,24 @@ while [[ "x${heketi_service}" == "x" ]] || [[ "${heketi_service}" == "" ]] heketi_service=$(${CLI} describe svc/heketi | grep "Endpoints:" | awk '{print $2}') done -heketi_pod=$(${CLI} get pod --no-headers --show-all --selector="heketi" | awk '{print $1}') +SHOW_ALL_OPT=$(${CLI} version -o json | python -c """ +# coding: utf8 +import json +import sys +try: + version = json.load(sys.stdin) +except ValueError as e: + print(\"Invalid json format in : %s Error: %s\" % (file, e)) + sys.exit(1) +show_all_opt = \"\" +if version['clientVersion']['major'] < \"2\": + if version['clientVersion']['minor'] < \"14\": + show_all_opt += \"--show-all\" +print(show_all_opt) +""" +) + +heketi_pod=$(${CLI} get pod --no-headers "${SHOW_ALL_OPT}" --selector="heketi" | awk '{print $1}') if [[ "${CLI}" == *oc\ * ]]; then heketi_service=$(${CLI} describe routes/heketi | grep "Requested Host:" | awk '{print $3}')