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

Issue 7610048: cmd/juju: bootstrap accepts --constraints

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 1 month ago by fwereade
Modified:
11 years, 1 month ago
Reviewers:
dimitern, mp+153600, dfc, jameinel
Visibility:
Public.

Description

cmd/juju: bootstrap accepts --constraints ...and passes them on to environs.Bootstrap, which passes them on to Environ.Bootstrap. Only the dummy provider actually handles constraints at the moment -- so we can test the bootstrap command -- all the others will be implemented in followups. https://code.launchpad.net/~fwereade/juju-core/bootstrap-constraints-2/+merge/153600 Requires: https://code.launchpad.net/~fwereade/juju-core/bootstrap-constraints-1/+merge/153523 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 13

Patch Set 2 : cmd/juju: bootstrap accepts --constraints #

Unified diffs Side-by-side diffs Delta from patch set Stats (+105 lines, -56 lines) Patch
A [revision details] View 1 1 chunk +2 lines, -0 lines 0 comments Download
M cmd/juju/bootstrap.go View 1 4 chunks +4 lines, -2 lines 0 comments Download
M cmd/juju/bootstrap_test.go View 1 5 chunks +26 lines, -10 lines 0 comments Download
M environs/bootstrap.go View 1 2 chunks +8 lines, -11 lines 0 comments Download
M environs/bootstrap_test.go View 1 5 chunks +24 lines, -5 lines 0 comments Download
M environs/dummy/environs.go View 1 4 chunks +9 lines, -3 lines 0 comments Download
M environs/ec2/ec2.go View 1 1 chunk +2 lines, -1 line 0 comments Download
M environs/ec2/local_test.go View 1 1 chunk +1 line, -1 line 0 comments Download
M environs/interface.go View 1 1 chunk +4 lines, -1 line 0 comments Download
M environs/jujutest/livetests.go View 1 3 chunks +3 lines, -3 lines 0 comments Download
M environs/jujutest/tests.go View 1 3 chunks +6 lines, -6 lines 0 comments Download
M environs/open_test.go View 2 chunks +2 lines, -1 line 0 comments Download
M environs/openstack/local_test.go View 1 3 chunks +3 lines, -3 lines 0 comments Download
M environs/openstack/provider.go View 1 1 chunk +2 lines, -1 line 0 comments Download
M juju/apiconn_test.go View 1 2 chunks +2 lines, -1 line 0 comments Download
M juju/conn_test.go View 1 6 chunks +6 lines, -6 lines 0 comments Download
M juju/testing/conn.go View 1 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 6
fwereade
Please take a look.
11 years, 1 month ago (2013-03-15 17:09:57 UTC) #1
dimitern
LGTM, with some suggestions/questions. https://codereview.appspot.com/7610048/diff/1/cmd/juju/bootstrap.go File cmd/juju/bootstrap.go (right): https://codereview.appspot.com/7610048/diff/1/cmd/juju/bootstrap.go#newcode29 cmd/juju/bootstrap.go:29: f.Var(state.ConstraintsValue{&c.Constraints}, "constraints", "set environment constraints") ...
11 years, 1 month ago (2013-03-15 17:33:20 UTC) #2
jameinel
LGTM https://codereview.appspot.com/7610048/diff/1/environs/bootstrap_test.go File environs/bootstrap_test.go (right): https://codereview.appspot.com/7610048/diff/1/environs/bootstrap_test.go#newcode39 environs/bootstrap_test.go:39: err := environs.Bootstrap(env, state.Constraints{}, false, nil) +1, as ...
11 years, 1 month ago (2013-03-18 18:04:58 UTC) #3
dfc
LGTM. https://codereview.appspot.com/7610048/diff/1/environs/bootstrap_test.go File environs/bootstrap_test.go (right): https://codereview.appspot.com/7610048/diff/1/environs/bootstrap_test.go#newcode39 environs/bootstrap_test.go:39: err := environs.Bootstrap(env, state.Constraints{}, false, nil) On 2013/03/18 ...
11 years, 1 month ago (2013-03-18 22:54:54 UTC) #4
thumper
On 2013/03/18 22:54:54, dfc wrote: > LGTM. > > https://codereview.appspot.com/7610048/diff/1/environs/bootstrap_test.go > File environs/bootstrap_test.go (right): > ...
11 years, 1 month ago (2013-03-18 23:07:54 UTC) #5
fwereade
11 years, 1 month ago (2013-03-19 10:30:36 UTC) #6
*** Submitted:

cmd/juju: bootstrap accepts --constraints

...and passes them on to environs.Bootstrap, which passes them on to
Environ.Bootstrap. Only the dummy provider actually handles constraints
at the moment -- so we can test the bootstrap command -- all the others
will be implemented in followups.

R=dimitern, jameinel, dfc, thumper
CC=
https://codereview.appspot.com/7610048

https://codereview.appspot.com/7610048/diff/1/cmd/juju/bootstrap.go
File cmd/juju/bootstrap.go (right):

https://codereview.appspot.com/7610048/diff/1/cmd/juju/bootstrap.go#newcode29
cmd/juju/bootstrap.go:29: f.Var(state.ConstraintsValue{&c.Constraints},
"constraints", "set environment constraints")
On 2013/03/15 17:33:20, dimitern wrote:
> This was included in the prereq CL with a slightly different wording - won't
it
> result in a merge conflict?

That was jujud, not juju

https://codereview.appspot.com/7610048/diff/1/cmd/juju/bootstrap_test.go
File cmd/juju/bootstrap_test.go (right):

https://codereview.appspot.com/7610048/diff/1/cmd/juju/bootstrap_test.go#newc...
cmd/juju/bootstrap_test.go:63: defer testing.MakeFakeHome(c, envConfig,
"brokenenv").Restore()
On 2013/03/15 17:33:20, dimitern wrote:
> this is iffy and kinda confusing - what's broken about it?

Dropped.

https://codereview.appspot.com/7610048/diff/1/environs/bootstrap.go
File environs/bootstrap.go (right):

https://codereview.appspot.com/7610048/diff/1/environs/bootstrap.go#newcode22
environs/bootstrap.go:22: // uploaded, as documented in Environ.Bootstrap.
On 2013/03/15 17:33:20, dimitern wrote:
> please, update the comment to include the constraints arg.

Done.

https://codereview.appspot.com/7610048/diff/1/environs/bootstrap_test.go
File environs/bootstrap_test.go (right):

https://codereview.appspot.com/7610048/diff/1/environs/bootstrap_test.go#newc...
environs/bootstrap_test.go:39: err := environs.Bootstrap(env,
state.Constraints{}, false, nil)
On 2013/03/18 22:54:54, dfc wrote:
> On 2013/03/18 18:04:58, jameinel wrote:
> > +1, as it also means the struct doesn't get copied when it doesn't need to.
> > Though I suppose we want to avoid the side-effect of passing in constraints
> and
> > then changing the in-memory struct later?
> > But that could just be the final e.constraints = *cons (so it does do an
> > explicit copy at that point).
> 
> I've pondered on this as well, passing a struct is less common than a pointer
to
> a struct, but in this case I think it is correct, if a little unorthodox.
> 
> By creating a new empty (zero value) constraint set here we guarantee that it
> can't be mutated afterwards by the caller. This is a useful property for
> something as contentious as constraints.
> 

Value semantics are useful; there's no reason to use nil when there's a
perfectly good zero value; and I don't believe the overhead of copying these
structs around a bit is going to hurt us.

https://codereview.appspot.com/7610048/diff/1/environs/interface.go
File environs/interface.go (right):

https://codereview.appspot.com/7610048/diff/1/environs/interface.go#newcode151
environs/interface.go:151: Bootstrap(cons state.Constraints, uploadTools bool,
stateServerCert, stateServerKey []byte) error
On 2013/03/15 17:33:20, dimitern wrote:
> please update the comment as well.

Done.
Sign in to reply to this message.

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