don't try to remove the node if kubeconfig doesn't exist

pull/6/head
Rye Terrell 2017-04-06 14:57:42 -05:00 committed by George Kraft
parent 258ee22858
commit 6e831d6fe9
1 changed files with 2 additions and 1 deletions

View File

@ -152,7 +152,8 @@ def shutdown():
- stop the kube-proxy service
- remove the 'kubernetes-worker.cni-plugins.installed' state
'''
kubectl('delete', 'node', gethostname())
if os.path.isfile(kubeconfig_path):
kubectl('delete', 'node', gethostname())
service_stop('kubelet')
service_stop('kube-proxy')
remove_state('kubernetes-worker.cni-plugins.installed')