Commit 89579c45 authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #48054 from juju-solutions/bug/terminate-etcd

Automatic merge from submit-queue (batch tested with PRs 48139, 48042, 47645, 48054, 48003) Add a failsafe for etcd not returning a connection string **What this PR does / why we need it**: Removing a kubernetes-master will fail as described on this issue: https://github.com/juju-solutions/bundle-canonical-kubernetes/issues/311 **Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes https://github.com/juju-solutions/bundle-canonical-kubernetes/issues/311 **Special notes for your reviewer**: This is a two liner defensive code. I am not totally sold on this patch. I might not be the right place to address the above issue. However, solving the problem on the etcd side and updating the interface scope to be unit (as suggested) seems much more involving. **Release note**: ``` Fix error when removing juju kubernetes-master unit ```
parents d19a2841 b3a11157
...@@ -305,6 +305,11 @@ def start_master(etcd): ...@@ -305,6 +305,11 @@ def start_master(etcd):
hookenv.status_set('maintenance', hookenv.status_set('maintenance',
'Configuring the Kubernetes master services.') 'Configuring the Kubernetes master services.')
freeze_service_cidr() freeze_service_cidr()
if not etcd.get_connection_string():
# etcd is not returning a connection string. This hapens when
# the master unit disconnects from etcd and is ready to terminate.
# No point in trying to start master services and fail. Just return.
return
handle_etcd_relation(etcd) handle_etcd_relation(etcd)
configure_master_services() configure_master_services()
hookenv.status_set('maintenance', hookenv.status_set('maintenance',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment