Skip errors when unregistering juju kubernetes-workers

This commit is contained in:
Konstantinos Tsakalozos 2017-06-27 16:57:43 +03:00
parent bce32b66cd
commit 90a57931af

View File

@ -160,8 +160,11 @@ def shutdown():
- delete the current node - delete the current node
- stop the worker services - stop the worker services
''' '''
if os.path.isfile(kubeconfig_path): try:
kubectl('delete', 'node', gethostname()) if os.path.isfile(kubeconfig_path):
kubectl('delete', 'node', gethostname())
except CalledProcessError:
hookenv.log('Failed to unregister node.')
service_stop('snap.kubelet.daemon') service_stop('snap.kubelet.daemon')
service_stop('snap.kube-proxy.daemon') service_stop('snap.kube-proxy.daemon')