Merge pull request #48440 from Cynerva/gkk/snap-upgrades-restart-services

Automatic merge from submit-queue (batch tested with PRs 48439, 48440, 48394)

Fix kubernetes charms not restarting services after snap upgrades

**What this PR does / why we need it**:

This fixes a problem where the Kubernetes charms don't restart services after upgrading snaps. This can cause certain fixes not to be picked up (for example https://github.com/juju-solutions/release/pull/10)

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #

**Special notes for your reviewer**:

**Release note**:

```release-note
Fixed kubernetes charms not restarting services after snap upgrades
```
pull/6/head
Kubernetes Submit Queue 2017-07-03 13:05:29 -07:00 committed by GitHub
commit e1d9ab205a
2 changed files with 2 additions and 0 deletions

View File

@ -155,6 +155,7 @@ def install_snaps():
hookenv.status_set('maintenance', 'Installing cdk-addons snap')
snap.install('cdk-addons', channel=channel)
set_state('kubernetes-master.snaps.installed')
remove_state('kubernetes-master.components.started')
@when('config.changed.channel')

View File

@ -149,6 +149,7 @@ def install_snaps():
hookenv.status_set('maintenance', 'Installing kube-proxy snap')
snap.install('kube-proxy', channel=channel, classic=True)
set_state('kubernetes-worker.snaps.installed')
set_state('kubernetes-worker.restart-needed')
remove_state('kubernetes-worker.snaps.upgrade-needed')
remove_state('kubernetes-worker.snaps.upgrade-specified')