Skip to content

Commit

Permalink
[Fix #47] Fix node status check crash for k8s agent
Browse files Browse the repository at this point in the history
For k8s agent node creation, node status check need
check whether pod is not None at first.

Signed-off-by: Haitao Yue <hightallyht@gmail.com>
  • Loading branch information
hightall committed Oct 24, 2019
1 parent 3961a1f commit 008c890
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/agent/kubernetes-agent/src/operations/create_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 008c890

Please sign in to comment.