Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Add application offers to allwatcher #7258
Conversation
| @@ -538,8 +538,8 @@ func (st *State) MongoSession() *mgo.Session { | ||
| return st.session | ||
| } | ||
| -func (st *State) Watch() *Multiwatcher { | ||
| - return NewMultiwatcher(st.workers.allManager()) | ||
| +func (st *State) Watch(perm permission.Access) *Multiwatcher { |
axw
Apr 21, 2017
Member
It seems really inappropriate to be passing in permissions here. State does not do permission checking, so this should be saying more specifically what the scope of the watch is. i.e. whether it should include application offers. Perhaps define a new struct which controls what things to watch?
| @@ -51,7 +54,7 @@ type allWatcherBaseSuite struct { | ||
| // setUpScenario adds some entities to the state so that | ||
| // we can check that they all get pulled in by | ||
| // all(Model)WatcherStateBacking.GetAll. | ||
| -func (s *allWatcherBaseSuite) setUpScenario(c *gc.C, st *State, units int) (entities entityInfoSlice) { | ||
| +func (s *allWatcherBaseSuite) setUpScenario(c *gc.C, st *State, units int, perm permission.Access) (entities entityInfoSlice) { |
axw
Apr 21, 2017
Member
and here, rather than perm, change it to "setupApplicationOffer bool" or similar
| @@ -538,8 +538,15 @@ func (st *State) MongoSession() *mgo.Session { | ||
| return st.session | ||
| } | ||
| -func (st *State) Watch() *Multiwatcher { | ||
| - return NewMultiwatcher(st.workers.allManager()) | ||
| +// WatchParams defines config to control watch |
| -func (st *State) Watch() *Multiwatcher { | ||
| - return NewMultiwatcher(st.workers.allManager()) | ||
| +// WatchParams defines config to control watch | ||
| +// entites are include when watching a model. |
| +// WatchParams defines config to control watch | ||
| +// entites are include when watching a model. | ||
| +type WatchParams struct { | ||
| + // IncludeOffers is true if application offers should be watched. |
|
$$merge$$ |
|
Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju |
|
Build failed: Tests failed |
|
$$merge$$ |
|
Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju |
|
Build failed: Tests failed |
|
$$merge$$ |
|
Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju |
|
Build failed: Tests failed |
|
Build failed: Tests failed |
wallyworld commentedApr 20, 2017
Description of change
The watcher used by the GUI needs to have application offers added to its model.
This required adding some permissions to the client facade back end so that only admins can see a model's offers. Also, ensure that remote app proxies from consuming apps are excluded from the watcher model.
Also add test coverage for remote applications to the client apiserver status.
QA steps
The GUI doesn't display offers yet, so just do a smoke test - set up a CMR scenario and use the GUI.