Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(213)

Issue 10554043: state/apiserver: more ops on ResourceRegistry

Can't Edit
Can't Publish+Mail
Start Review
Created:
12 years, 8 months ago by rog
Modified:
12 years, 8 months ago
Reviewers:
dimitern, mp+171364, fwereade
Visibility:
Public.

Description

state/apiserver: more ops on ResourceRegistry For the upcoming API restructuring, packages external of the apiserver package will need to retrieve and stop resources. This adds the necessary operations to ResourceRegistry and changes various places to use them in preparation for factoring them out of apiserver itself. https://code.launchpad.net/~rogpeppe/juju-core/330-apiserver-resource-get/+merge/171364 (do not edit description out of merge proposal)

Patch Set 1 #

Patch Set 2 : state/apiserver: more ops on ResourceRegistry #

Total comments: 5

Patch Set 3 : state/apiserver: more ops on ResourceRegistry #

Unified diffs Side-by-side diffs Delta from patch set Stats (+134 lines, -83 lines) Patch
A [revision details] View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M state/apiserver/common/interfaces.go View 1 chunk +10 lines, -0 lines 0 comments Download
M state/apiserver/machine/machiner_test.go View 1 chunk +8 lines, -0 lines 0 comments Download
M state/apiserver/resource.go View 2 chunks +26 lines, -18 lines 0 comments Download
M state/apiserver/root.go View 1 chunk +48 lines, -45 lines 0 comments Download
M state/apiserver/watcher.go View 1 chunk +40 lines, -20 lines 0 comments Download

Messages

Total messages: 4
rog
Please take a look.
12 years, 8 months ago (2013-06-25 16:40:06 UTC) #1
fwereade
LGTM modulo the tomb question. It'd clearly be a behaviour change, and so not for ...
12 years, 8 months ago (2013-06-26 14:47:44 UTC) #2
dimitern
LGTM modulo the two comments below. https://codereview.appspot.com/10554043/diff/3001/state/apiserver/machine/machiner_test.go File state/apiserver/machine/machiner_test.go (right): https://codereview.appspot.com/10554043/diff/3001/state/apiserver/machine/machiner_test.go#newcode36 state/apiserver/machine/machiner_test.go:36: panic("unimplemented") why panic? ...
12 years, 8 months ago (2013-06-26 14:54:00 UTC) #3
rog
12 years, 8 months ago (2013-06-26 15:01:09 UTC) #4
Please take a look.

https://codereview.appspot.com/10554043/diff/3001/state/apiserver/machine/mac...
File state/apiserver/machine/machiner_test.go (right):

https://codereview.appspot.com/10554043/diff/3001/state/apiserver/machine/mac...
state/apiserver/machine/machiner_test.go:36: panic("unimplemented")
On 2013/06/26 14:54:00, dimitern wrote:
> why panic? return registry[id] instead

i'm panicing because i don't expect these methods to be called in these tests;
no point in writing code that's never used. with john's upcoming shared
fakeResourceRegistry, i'm sure these will be fleshed out.

https://codereview.appspot.com/10554043/diff/3001/state/apiserver/watcher.go
File state/apiserver/watcher.go (right):

https://codereview.appspot.com/10554043/diff/3001/state/apiserver/watcher.go#...
state/apiserver/watcher.go:40: if _, ok := <-w.watcher.Changes(); ok {
On 2013/06/26 14:47:45, fwereade wrote:
> Is there some sort of tomb we should be selecting on here?

no, not AFAICS - the watcher itself has a tomb, and when it dies, it closes the
channel.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b