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

Issue 10809043: state/api/apiserver/upgrader: Implement Upgrader

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 10 months ago by jameinel
Modified:
10 years, 10 months ago
Reviewers:
mp+172239, gz, fwereade
Visibility:
Public.

Description

state/api/apiserver/upgrader: Implement Upgrader This implements the basic API for Upgrader for machine agents. It exposes the ability to watch for API Version changes, and then query for what the correct version of Tools. At the moment, WatchAPIVersion starts an EnvironConfigWatcher which matches the existing upgrader code. However, it means the underlying watcher differs from the "NotifyWatcher" that the other code paths would depend on. In talking with William there isn't a strong case for doing it this way, and it would be better to implement an NotifyWatcher on the Environment document, rather than implementing a Next that returns actual content. This also doesn't try to implement Auth checking for Unit agents, which will also need to use this API. But I'd like to get this reviewed and landed as a general outline of what the API will look like. Originally, I wanted just 1 API which would be a watcher that on changes would return the Tools objects directly. I also thought we could create a multi-watcher rather than many watchers. But this was straightforward and easy, and we can live with it for now. https://code.launchpad.net/~jameinel/juju-core/upgrader-api/+merge/172239 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 18

Patch Set 2 : state/api/apiserver/upgrader: Implement Upgrader #

Total comments: 15

Patch Set 3 : state/api/apiserver/upgrader: Implement Upgrader #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+621 lines, -0 lines) Patch
A [revision details] View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M state/api/params/params.go View 1 2 2 chunks +50 lines, -0 lines 1 comment Download
M state/api/state.go View 2 chunks +6 lines, -0 lines 0 comments Download
A state/api/upgrader/upgrader.go View 1 2 1 chunk +18 lines, -0 lines 0 comments Download
A state/api/upgrader/upgrader_test.go View 1 2 1 chunk +116 lines, -0 lines 1 comment Download
M state/apiserver/common/errors.go View 1 chunk +1 line, -0 lines 0 comments Download
A state/apiserver/upgrader/suite_test.go View 1 chunk +13 lines, -0 lines 0 comments Download
A state/apiserver/upgrader/upgrader.go View 1 2 1 chunk +163 lines, -0 lines 0 comments Download
A state/apiserver/upgrader/upgrader_test.go View 1 2 1 chunk +252 lines, -0 lines 1 comment Download

Messages

Total messages: 8
jameinel
Please take a look.
10 years, 10 months ago (2013-06-30 12:31:24 UTC) #1
fwereade
Solid in essence: a few trivials, one missing method (fine as a followup), but am ...
10 years, 10 months ago (2013-06-30 21:35:15 UTC) #2
jameinel
Please take a look. https://codereview.appspot.com/10809043/diff/1/state/api/upgrader/upgrader_test.go File state/api/upgrader/upgrader_test.go (right): https://codereview.appspot.com/10809043/diff/1/state/api/upgrader/upgrader_test.go#newcode8 state/api/upgrader/upgrader_test.go:8: //"launchpad.net/juju-core/errors" On 2013/06/30 21:35:15, fwereade ...
10 years, 10 months ago (2013-07-01 07:18:02 UTC) #3
gz
LGTM with some comments on minor doc and code tidiness things. https://codereview.appspot.com/10809043/diff/1/state/apiserver/upgrader/upgrader.go File state/apiserver/upgrader/upgrader.go (right): ...
10 years, 10 months ago (2013-07-02 11:25:52 UTC) #4
fwereade
OK, dammit, I didn't recall (didn't know?) how we stored agent tools in state in ...
10 years, 10 months ago (2013-07-02 13:46:38 UTC) #5
jameinel
On 2013/07/02 13:46:38, fwereade wrote: > OK, dammit, I didn't recall (didn't know?) how we ...
10 years, 10 months ago (2013-07-03 04:50:09 UTC) #6
jameinel
Please take a look. https://codereview.appspot.com/10809043/diff/6001/state/api/params/params.go File state/api/params/params.go (right): https://codereview.appspot.com/10809043/diff/6001/state/api/params/params.go#newcode254 state/api/params/params.go:254: // This is a flatted ...
10 years, 10 months ago (2013-07-03 05:14:12 UTC) #7
fwereade
10 years, 10 months ago (2013-07-03 09:36:57 UTC) #8
LGTM

https://codereview.appspot.com/10809043/diff/17001/state/api/params/params.go
File state/api/params/params.go (right):

https://codereview.appspot.com/10809043/diff/17001/state/api/params/params.go...
state/api/params/params.go:75: // Details about a single agent
Agent identifies a single agent.

https://codereview.appspot.com/10809043/diff/17001/state/api/upgrader/upgrade...
File state/api/upgrader/upgrader_test.go (right):

https://codereview.appspot.com/10809043/diff/17001/state/api/upgrader/upgrade...
state/api/upgrader/upgrader_test.go:54: s.rawCharm, err =
s.State.Charm(charmURL(0))
not immediately clear how that charm gets into state in the first place, but if
it does, then fair enough:)

https://codereview.appspot.com/10809043/diff/17001/state/apiserver/upgrader/u...
File state/apiserver/upgrader/upgrader_test.go (right):

https://codereview.appspot.com/10809043/diff/17001/state/apiserver/upgrader/u...
state/apiserver/upgrader/upgrader_test.go:83: // TODO: When this becomes a true
EntityWatcher, use
I really appreciate blank lines before comments
Sign in to reply to this message.

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