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

Issue 14032043: Wire up prechecker

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 7 months ago by axw
Modified:
10 years, 5 months ago
Reviewers:
mp+188001, axw1, fwereade
Visibility:
Public.

Description

Wire up prechecker This change is to set a Prechecker in the CLI, and in cmd/jujud. The Environ itself is a Prechecker, and that is what is assigned to the state object. State now calls the prechecker when decoding to create instance/container machine entries in state. The prechecker calls are elided for "injected" machines. Environ embeds the Prechecker interface. All Environ implementations now embed environs.EnvironBase, which implements defaults for an environs.Environ. Currently it only implements Prechecker, by embedding a NilPrechecker (i.e. one that allows everything through). All Environs, apart from MAAS, disallow containers. The null provider disallows everything (unless done "manually"). https://code.launchpad.net/~axwalk/juju-core/wire-up-prechecker/+merge/188001 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 5

Patch Set 2 : Wire up prechecker #

Total comments: 12

Patch Set 3 : Wire up prechecker #

Patch Set 4 : Wire up prechecker #

Total comments: 15

Patch Set 5 : Wire up prechecker #

Total comments: 2

Patch Set 6 : Wire up prechecker #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+322 lines, -70 lines) Patch
A [revision details] View 1 2 3 4 5 1 chunk +2 lines, -0 lines 0 comments Download
M cmd/jujud/agent.go View 1 2 chunks +9 lines, -0 lines 0 comments Download
M cmd/jujud/machine.go View 1 2 3 4 5 1 chunk +13 lines, -0 lines 2 comments Download
A environs/base.go View 1 2 1 chunk +22 lines, -0 lines 0 comments Download
M environs/interface.go View 1 2 2 chunks +5 lines, -22 lines 0 comments Download
M environs/jujutest/livetests.go View 1 2 3 4 1 chunk +4 lines, -9 lines 0 comments Download
M juju/conn.go View 1 2 3 4 5 3 chunks +28 lines, -11 lines 0 comments Download
M juju/conn_test.go View 1 2 3 4 2 chunks +36 lines, -0 lines 0 comments Download
M provider/azure/environ.go View 1 2 3 4 1 chunk +2 lines, -2 lines 0 comments Download
M provider/dummy/environs.go View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M provider/ec2/ec2.go View 1 2 3 4 1 chunk +2 lines, -2 lines 0 comments Download
M provider/ec2/local_test.go View 1 2 3 4 1 chunk +2 lines, -4 lines 0 comments Download
M provider/local/environ.go View 1 2 3 4 1 chunk +2 lines, -2 lines 0 comments Download
M provider/local/environ_test.go View 1 2 3 4 2 chunks +2 lines, -5 lines 0 comments Download
M provider/maas/environ.go View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M provider/null/environ.go View 1 2 3 4 2 chunks +9 lines, -0 lines 0 comments Download
M provider/openstack/local_test.go View 1 2 3 4 1 chunk +2 lines, -4 lines 0 comments Download
M provider/openstack/provider.go View 1 2 3 4 1 chunk +2 lines, -2 lines 0 comments Download
M state/open.go View 1 1 chunk +2 lines, -2 lines 0 comments Download
M state/state.go View 1 2 5 chunks +57 lines, -5 lines 2 comments Download
M state/state_test.go View 1 2 1 chunk +117 lines, -0 lines 0 comments Download

Messages

Total messages: 15
fwereade
Thoughts: https://codereview.appspot.com/14032043/diff/1/state/state.go File state/state.go (right): https://codereview.appspot.com/14032043/diff/1/state/state.go#newcode292 state/state.go:292: // Prechecker is a clone of environs.Prechecker, here ...
10 years, 7 months ago (2013-09-27 10:59:22 UTC) #1
axw1
https://codereview.appspot.com/14032043/diff/1/state/state.go File state/state.go (right): https://codereview.appspot.com/14032043/diff/1/state/state.go#newcode292 state/state.go:292: // Prechecker is a clone of environs.Prechecker, here to ...
10 years, 7 months ago (2013-09-29 16:20:44 UTC) #2
axw
Please take a look.
10 years, 7 months ago (2013-10-01 08:33:01 UTC) #3
fwereade
I feel like we may be converging on something... let me know what you think ...
10 years, 7 months ago (2013-10-01 10:24:32 UTC) #4
axw1
https://codereview.appspot.com/14032043/diff/6001/cmd/juju/addmachine.go File cmd/juju/addmachine.go (right): https://codereview.appspot.com/14032043/diff/6001/cmd/juju/addmachine.go#newcode98 cmd/juju/addmachine.go:98: conn.State.SetPrechecker(nil) On 2013/10/01 10:24:33, fwereade wrote: > This feels ...
10 years, 7 months ago (2013-10-02 09:18:49 UTC) #5
axw
Please take a look.
10 years, 7 months ago (2013-10-02 09:28:26 UTC) #6
axw
Please take a look.
10 years, 7 months ago (2013-10-04 03:40:57 UTC) #7
axw1
On 2013/10/04 03:40:57, axw wrote: > Please take a look. Updated juju/conn.go to call SetPrechecker ...
10 years, 7 months ago (2013-10-04 03:52:38 UTC) #8
fwereade
Sorry this one has hung around so long, but I think it's basically there. Last ...
10 years, 6 months ago (2013-10-08 07:30:42 UTC) #9
axw
Thanks for the review. https://codereview.appspot.com/14032043/diff/19001/juju/conn.go File juju/conn.go (right): https://codereview.appspot.com/14032043/diff/19001/juju/conn.go#newcode171 juju/conn.go:171: func (c *Conn) setPrechecker() error ...
10 years, 6 months ago (2013-10-08 09:52:33 UTC) #10
axw
Please take a look.
10 years, 6 months ago (2013-10-08 09:56:34 UTC) #11
fwereade
Apart from the extra attrs, this seems fine -- but they could use a spot ...
10 years, 6 months ago (2013-10-09 08:46:30 UTC) #12
axw
Please take a look.
10 years, 6 months ago (2013-10-09 09:54:16 UTC) #13
fwereade
Sorry, this lingered so long that I've lost context, so the comments below may be ...
10 years, 5 months ago (2013-11-07 09:44:52 UTC) #14
axw
10 years, 5 months ago (2013-11-08 07:25:28 UTC) #15
May want to hold off until synchronous bootstrap now, given the oversight on
getting an environ.

https://codereview.appspot.com/14032043/diff/37001/cmd/jujud/machine.go
File cmd/jujud/machine.go (right):

https://codereview.appspot.com/14032043/diff/37001/cmd/jujud/machine.go#newco...
cmd/jujud/machine.go:249: environ, err := getStateEnviron(st)
On 2013/11/07 09:44:53, fwereade wrote:
> Remind me -- how does this work when the environ config is incomplete? Don't
we
> still need a state worker then?

Well, oops, I don't think it does work.

I must have coded this against a version of the manual provider that couldn't
have an incomplete config (there was a time when it had defaults for
everything).

This would change after synchronous bootstrap, since the agent will never have
an incomplete config. Doesn't work for now, though.

https://codereview.appspot.com/14032043/diff/37001/state/state.go
File state/state.go (right):

https://codereview.appspot.com/14032043/diff/37001/state/state.go#newcode257
state/state.go:257: }
On 2013/11/07 09:44:53, fwereade wrote:
> OK, Kapil's concerns are getting to me a little bit. Gut feeling: is it
> sane/easy/reasonable to allow container=lxc (which we *really* should name
> isolation=lxc) constraints to create unroutable containers, but to restrict
> add-machine so it only allows addressable ones?

It's probably doable, but that sounds a bit hackish to me. I'd rather just be
explicit about requiring (at worst) an unroutable container.
 
> (if we implemented lxc:X handling with a pseudo-provider maybe *that* could be
> the bit responsible for container checking?)
Sign in to reply to this message.

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