From 008c8907b55ccf550d2043795aff62d01971570f Mon Sep 17 00:00:00 2001 From: Haitao Yue Date: Thu, 24 Oct 2019 11:22:28 +0800 Subject: [PATCH] [Fix #47] Fix node status check crash for k8s agent For k8s agent node creation, node status check need check whether pod is not None at first. Signed-off-by: Haitao Yue --- src/agent/kubernetes-agent/src/operations/create_node.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/agent/kubernetes-agent/src/operations/create_node.py b/src/agent/kubernetes-agent/src/operations/create_node.py index e338524b5..4cfd41928 100644 --- a/src/agent/kubernetes-agent/src/operations/create_node.py +++ b/src/agent/kubernetes-agent/src/operations/create_node.py @@ -137,7 +137,7 @@ def _create_fabric_node(): node_status = NodeStatus.Error.value for i in range(1, MAX_QUERY_RETRY): pod = k8s_client.get_pod(AGENT_ID, deploy_name) - if pod.status.phase == "Running": + if pod and pod.status.phase == "Running": node_status = NodeStatus.Running.value break sleep(5)