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

Issue 8429044: environs: add machineNonce to StartInstance() (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years ago by dimitern
Modified:
11 years ago
Reviewers:
mp+157432
Visibility:
Public.

Description

environs: add machineNonce to StartInstance() Continuing from the previous CL, this propagates the machine nonce throughout environs. Now the machineNonce is passed to StartInstance() in all providers. In a follow-up the support for handling nonces in state will be added. https://code.launchpad.net/~dimitern/juju-core/026-enable-nonced-provisioning/+merge/157432 Requires: https://code.launchpad.net/~dimitern/juju-core/025-add-machinenonce-to-agent-conf-and-machine-config/+merge/157422 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 8

Patch Set 2 : environs: add machineNonce to StartInstance() #

Total comments: 15

Patch Set 3 : environs: add machineNonce to StartInstance() #

Unified diffs Side-by-side diffs Delta from patch set Stats (+83 lines, -55 lines) Patch
A [revision details] View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M environs/dummy/environs.go View 1 2 4 chunks +20 lines, -15 lines 0 comments Download
M environs/ec2/ec2.go View 4 chunks +18 lines, -16 lines 0 comments Download
M environs/ec2/live_test.go View 1 chunk +1 line, -1 line 0 comments Download
M environs/ec2/local_test.go View 1 chunk +1 line, -1 line 0 comments Download
M environs/interface.go View 1 1 chunk +7 lines, -9 lines 0 comments Download
M environs/jujutest/livetests.go View 1 2 2 chunks +12 lines, -1 line 0 comments Download
M environs/openstack/local_test.go View 1 chunk +1 line, -1 line 0 comments Download
M environs/openstack/provider.go View 4 chunks +12 lines, -10 lines 0 comments Download
M juju/conn.go View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M juju/testing/conn.go View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M state/state.go View 1 chunk +3 lines, -0 lines 0 comments Download
M worker/provisioner/provisioner.go View 1 1 chunk +2 lines, -1 line 0 comments Download
M worker/provisioner/provisioner_test.go View 1 1 chunk +2 lines, -0 lines 0 comments Download

Messages

Total messages: 8
dimitern
Please take a look.
11 years ago (2013-04-05 16:52:54 UTC) #1
fwereade
I'm a bit lairy of the lack of testing here. I accept (and HATE HATE ...
11 years ago (2013-04-05 17:19:56 UTC) #2
fwereade
On 2013/04/05 17:19:56, fwereade wrote: > This needs to have a value that isn't "", ...
11 years ago (2013-04-05 21:07:51 UTC) #3
dimitern
Please take a look. https://codereview.appspot.com/8429044/diff/1/environs/interface.go File environs/interface.go (right): https://codereview.appspot.com/8429044/diff/1/environs/interface.go#newcode169 environs/interface.go:169: // with the provided machine ...
11 years ago (2013-04-08 12:33:40 UTC) #4
rog
LGTM with one query below https://codereview.appspot.com/8429044/diff/7001/environs/ec2/ec2.go File environs/ec2/ec2.go (right): https://codereview.appspot.com/8429044/diff/7001/environs/ec2/ec2.go#newcode291 environs/ec2/ec2.go:291: machineNonce: state.BootstrapNonce, why do ...
11 years ago (2013-04-08 12:46:48 UTC) #5
TheMue
Looks fine, only one little comment. https://codereview.appspot.com/8429044/diff/7001/juju/conn.go File juju/conn.go (right): https://codereview.appspot.com/8429044/diff/7001/juju/conn.go#newcode51 juju/conn.go:51: log.Noticef("juju: unauthorized error ...
11 years ago (2013-04-08 12:53:28 UTC) #6
fwereade
LGTM https://codereview.appspot.com/8429044/diff/7001/environs/ec2/ec2.go File environs/ec2/ec2.go (right): https://codereview.appspot.com/8429044/diff/7001/environs/ec2/ec2.go#newcode383 environs/ec2/ec2.go:383: func (e *environ) StartInstance(machineId, machineNonce string, series string, ...
11 years ago (2013-04-08 13:26:42 UTC) #7
dimitern
11 years ago (2013-04-08 15:33:17 UTC) #8
*** Submitted:

environs: add machineNonce to StartInstance()

Continuing from the previous CL, this propagates
the machine nonce throughout environs.

Now the machineNonce is passed to StartInstance()
in all providers. In a follow-up the support for
handling nonces in state will be added.

R=fwereade, rog, TheMue
CC=
https://codereview.appspot.com/8429044

https://codereview.appspot.com/8429044/diff/7001/environs/ec2/ec2.go
File environs/ec2/ec2.go (right):

https://codereview.appspot.com/8429044/diff/7001/environs/ec2/ec2.go#newcode291
environs/ec2/ec2.go:291: machineNonce: state.BootstrapNonce,
On 2013/04/08 12:46:48, rog wrote:
> why do we need a special value here?

As discussed: we need a special value anyway, because this is set at bootstrap
time, rather than by the provisioner. It has to be non-empty (otherwise it feels
wrong), and it has to have some value. I lean towards agreeing with fwereade
about having context of the user who created the environment (user-admin).

https://codereview.appspot.com/8429044/diff/7001/environs/ec2/ec2.go#newcode383
environs/ec2/ec2.go:383: func (e *environ) StartInstance(machineId, machineNonce
string, series string, cons constraints.Value, info *state.Info, apiInfo
*api.Info) (environs.Instance, error) {
On 2013/04/08 13:26:42, fwereade wrote:
> On 2013/04/08 12:46:48, rog wrote:
> > let's factor out these args into a struct at some point!
> 
> +1, but not this branch -- definitely next time we have to change the
signature
> though.

I agree, next time these args should be factored out into a struct.

https://codereview.appspot.com/8429044/diff/7001/environs/jujutest/livetests.go
File environs/jujutest/livetests.go (right):

https://codereview.appspot.com/8429044/diff/7001/environs/jujutest/livetests....
environs/jujutest/livetests.go:686: inst, err := t.Env.StartInstance("4",
"fake_nonce", "unknownseries", constraints.Value{},
testing.InvalidStateInfo("4"), testing.InvalidAPIInfo("4"))
On 2013/04/08 13:26:42, fwereade wrote:
> You can add another test that does pass an empty nonce and check that all the
> providers return an error.

Done.

https://codereview.appspot.com/8429044/diff/7001/juju/conn.go
File juju/conn.go (right):

https://codereview.appspot.com/8429044/diff/7001/juju/conn.go#newcode51
juju/conn.go:51: log.Noticef("juju: unauthorized error while connecting to state
server; retrying")
On 2013/04/08 13:26:42, fwereade wrote:
> On 2013/04/08 12:53:28, TheMue wrote:
> > Sounds to me like the error is unauthorized, maybe better "authorization
error
> > while ...".
> 
> +1

Done.

https://codereview.appspot.com/8429044/diff/7001/juju/testing/conn.go
File juju/testing/conn.go (right):

https://codereview.appspot.com/8429044/diff/7001/juju/testing/conn.go#newcode80
juju/testing/conn.go:80: "invalid nonce",
On 2013/04/08 13:26:42, fwereade wrote:
> I prefer the term "fake" to "invalid" in this context.

Done.

https://codereview.appspot.com/8429044/diff/7001/state/state.go
File state/state.go (right):

https://codereview.appspot.com/8429044/diff/7001/state/state.go#newcode71
state/state.go:71: const BootstrapNonce = "user-admin:bootstrap"
On 2013/04/08 13:26:42, fwereade wrote:
> On 2013/04/08 12:46:48, rog wrote:
> > or just "bootstrap" ?
> 
> I rather like badging them with the tag of the responsible entity.

(see above about discussion)
Sign in to reply to this message.

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