relation status watcher now a strings watcher, shared with watch relations #7783

Merged
merged 1 commit into from Aug 24, 2017

Conversation

Projects
None yet
3 participants
Owner

wallyworld commented Aug 24, 2017

Description of change

The state relation status watcher is changed to a strings watcher and the bespoke watcher removed. This then allows the 2 relations watchers to be consolidated to use the single shared state watcher:
application -> WatchRelations
relation -> WatchStatus

A whole bunch of code is deleted as a result.

Both of the above watchers now return the keys of any relation that has a life or status change. Infrastructure that uses the above has been tweaked accordingly. We also introduce status to the relation data model.

A followup PR will use the new watcher behaviour in the uniter to react to relation status changes.

QA steps

No visible change. Smoke test cmr and non-cmr deployments.

@@ -384,11 +384,25 @@ func (api *CrossModelRelationsAPI) WatchRelationsStatus(
}
results.Results[i].RelationStatusWatcherId = api.resources.Register(w)
changesParams := make([]params.RelationStatusChange, len(changes))
- for j, ch := range changes {
+ for j, key := range changes {
@babbageclunk

babbageclunk Aug 24, 2017

Member

Any way you can share this code somehow with srvRelationStatusWatcher.Next?

Owner

wallyworld commented Aug 24, 2017

$$merge$$

Contributor

jujubot commented Aug 24, 2017

Status: merge request accepted. Url: http://ci.jujucharms.com/job/github-merge-juju

@jujubot jujubot merged commit 79a2e0e into juju:develop Aug 24, 2017

1 check passed

continuous-integration/jenkins/pr-merge This commit looks good
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment