bugfix: right cols to get available pods 02/67102/1
authorYang (Gabriel) Yu <Gabriel.yuyang@huawei.com>
Mon, 25 Feb 2019 06:38:29 +0000 (14:38 +0800)
committerYang (Gabriel) Yu <Gabriel.yuyang@huawei.com>
Mon, 25 Feb 2019 06:38:29 +0000 (14:38 +0800)
JIRA: BOTTLENECK-251

It seems the displaying of kubectl get pods changes and the
number of available pods is at the 4th cols.

Change-Id: I4b00bd084133a47907a0c7c9c655852b1ea52324
Signed-off-by: Yang (Gabriel) Yu <Gabriel.yuyang@huawei.com>
utils/k8s_setup/k8s_utils.py

index a89889f..ad2cc99 100644 (file)
@@ -67,7 +67,7 @@ def get_deployment_status(name, namespace):
 
 def get_available_pods(name, namespace):
     CMD = ("kubectl get deployment --namespace={} | grep {}".format(
-        namespace, name) + " | awk '{print $5}'")
+        namespace, name) + " | awk '{print $4}'")
     available_pods = commands.getstatusoutput(CMD)
     return int(available_pods[1])