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

Issue 6464074: cmd/jujud: add Upgrader type.

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

Description

cmd/jujud: add Upgrader type. This conforms to the task interface as expected by runTasks, which should make it simple to add upgrading logic to agents. https://code.launchpad.net/~rogpeppe/juju-core/021-jujud-upgrader/+merge/120089 (do not edit description out of merge proposal)

Patch Set 1 #

Patch Set 2 : cmd/jujud: add Upgrader type. #

Patch Set 3 : cmd/jujud: add Upgrader type. #

Total comments: 30

Patch Set 4 : cmd/jujud: add Upgrader type. #

Patch Set 5 : cmd/jujud: add Upgrader type. #

Total comments: 19

Patch Set 6 : cmd/jujud: add Upgrader type. #

Patch Set 7 : cmd/jujud: add Upgrader type. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+384 lines, -0 lines) Patch
A [revision details] View 1 2 3 4 5 6 1 chunk +2 lines, -0 lines 0 comments Download
A cmd/jujud/upgrade.go View 1 2 3 4 5 6 1 chunk +149 lines, -0 lines 0 comments Download
A cmd/jujud/upgrade_test.go View 1 2 3 4 5 6 1 chunk +233 lines, -0 lines 0 comments Download

Messages

Total messages: 9
rog
Please take a look.
11 years, 8 months ago (2012-08-17 09:29:11 UTC) #1
rog
Please take a look.
11 years, 8 months ago (2012-08-17 09:47:37 UTC) #2
fwereade
looks good, but a few points: https://codereview.appspot.com/6464074/diff/1043/cmd/jujud/upgrade.go File cmd/jujud/upgrade.go (right): https://codereview.appspot.com/6464074/diff/1043/cmd/jujud/upgrade.go#newcode15 cmd/jujud/upgrade.go:15: type Upgrader struct ...
11 years, 8 months ago (2012-08-17 12:53:22 UTC) #3
niemeyer
Very nice! https://codereview.appspot.com/6464074/diff/1043/cmd/jujud/upgrade.go File cmd/jujud/upgrade.go (right): https://codereview.appspot.com/6464074/diff/1043/cmd/jujud/upgrade.go#newcode26 cmd/jujud/upgrade.go:26: return fmt.Sprintf("agent has been upgraded to %v ...
11 years, 8 months ago (2012-08-17 14:49:23 UTC) #4
rog
Please take a look. https://codereview.appspot.com/6464074/diff/1043/cmd/jujud/upgrade.go File cmd/jujud/upgrade.go (right): https://codereview.appspot.com/6464074/diff/1043/cmd/jujud/upgrade.go#newcode15 cmd/jujud/upgrade.go:15: type Upgrader struct { On ...
11 years, 8 months ago (2012-08-17 15:15:32 UTC) #5
rog
Please take a look.
11 years, 8 months ago (2012-08-17 15:38:58 UTC) #6
niemeyer
https://codereview.appspot.com/6464074/diff/2005/cmd/jujud/upgrade.go File cmd/jujud/upgrade.go (right): https://codereview.appspot.com/6464074/diff/2005/cmd/jujud/upgrade.go#newcode15 cmd/jujud/upgrade.go:15: // Upgrader represents a upgrader task. // An Upgrader ...
11 years, 8 months ago (2012-08-17 15:57:09 UTC) #7
niemeyer
Oh, LGTM with those fixed.
11 years, 8 months ago (2012-08-17 15:58:42 UTC) #8
rog
11 years, 8 months ago (2012-08-17 16:12:49 UTC) #9
*** Submitted:

cmd/jujud: add Upgrader type.

This conforms to the task interface as expected by
runTasks, which should make it simple to add upgrading
logic to agents.

R=fwereade, niemeyer
CC=
https://codereview.appspot.com/6464074

https://codereview.appspot.com/6464074/diff/2005/cmd/jujud/upgrade.go
File cmd/jujud/upgrade.go (right):

https://codereview.appspot.com/6464074/diff/2005/cmd/jujud/upgrade.go#newcode15
cmd/jujud/upgrade.go:15: // Upgrader represents a upgrader task.
On 2012/08/17 15:57:09, niemeyer wrote:
> // An Upgrader observes the version information for an agent in the
> // environment state, and handles the downloading and unpacking of
> // new versions of the juju tools when necessary.
> //
> // When a new version is available Wait and Stop return UpgradedError.

Done.

https://codereview.appspot.com/6464074/diff/2005/cmd/jujud/upgrade.go#newcode22
cmd/jujud/upgrade.go:22: // UpgradedError the status from an Upgrader when
On 2012/08/17 15:57:09, niemeyer wrote:
> // UpgradedError is returned by an Upgrader to report that
> // an upgrade has been performed and a restart is due.

Done.

https://codereview.appspot.com/6464074/diff/2005/cmd/jujud/upgrade.go#newcode32
cmd/jujud/upgrade.go:32: // AgentState represents the state of an agent.
On 2012/08/17 15:57:09, niemeyer wrote:
> // The AgentState interface is implemented by state types
> // that represent running agents.

Done.

https://codereview.appspot.com/6464074/diff/2005/cmd/jujud/upgrade.go#newcode43
cmd/jujud/upgrade.go:43: // tools for the agent with the given name.  given
name.  If an upgrade
On 2012/08/17 15:57:09, niemeyer wrote:
> // NewUpgrader returns a new Upgrader watching the given agent.
> 
> The rest is documented in the respective types.

Done.

https://codereview.appspot.com/6464074/diff/2005/cmd/jujud/upgrade.go#newcode46
cmd/jujud/upgrade.go:46: func NewUpgrader(agentName string, as AgentState)
*Upgrader {
On 2012/08/17 15:57:09, niemeyer wrote:
> s/as/agentState/

Done.

https://codereview.appspot.com/6464074/diff/2005/cmd/jujud/upgrade.go#newcode129
cmd/jujud/upgrade.go:129: log.Printf("download %v failed: %v", tools.Binary,
status.Err)
On 2012/08/17 15:57:09, niemeyer wrote:
> s/download/& of/

Done.

https://codereview.appspot.com/6464074/diff/2005/cmd/jujud/upgrade.go#newcode135
cmd/jujud/upgrade.go:135: log.Printf("%s agent: cannot remove temporary download
file: %v", u.agentName, err)
On 2012/08/17 15:57:09, niemeyer wrote:
> Why is this prefixed by "%s agent:" and not everything else?

no reason. done.

https://codereview.appspot.com/6464074/diff/2005/cmd/jujud/upgrade_test.go
File cmd/jujud/upgrade_test.go (right):

https://codereview.appspot.com/6464074/diff/2005/cmd/jujud/upgrade_test.go#ne...
cmd/jujud/upgrade_test.go:116: }
On 2012/08/17 15:57:09, niemeyer wrote:
> storage := s.Conn.Environ.Storage()

Done.

https://codereview.appspot.com/6464074/diff/2005/cmd/jujud/upgrade_test.go#ne...
cmd/jujud/upgrade_test.go:186: case <-time.After(200 * time.Millisecond):
On 2012/08/17 15:57:09, niemeyer wrote:
> Can we reduce this to 100?  It's a guess anyway, so we may as well not delay
the
> test further.

Done.
Sign in to reply to this message.

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