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

Issue 10534043: Add "container" to constraints (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 10 months ago by wallyworld
Modified:
10 years, 10 months ago
Reviewers:
dimitern, mp+171235, fwereade, thumper
Visibility:
Public.

Description

Add "container" to constraints This branch adds support for a container constraint to be specified. The constraint is specified like so: container=lxc It is stored in state for environment constraints and service constraints but not used yet. The container type and other related definitions were moved from the state package to instance to avoid dependency issues. https://code.launchpad.net/~wallyworld/juju-core/container-constraint/+merge/171235 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 2

Patch Set 2 : Add "container" to constraints #

Patch Set 3 : Add "container" to constraints #

Total comments: 17
Unified diffs Side-by-side diffs Delta from patch set Stats (+219 lines, -47 lines) Patch
A [revision details] View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M cmd/juju/addmachine.go View 4 chunks +8 lines, -8 lines 0 comments Download
M cmd/juju/addmachine_test.go View 5 chunks +6 lines, -3 lines 0 comments Download
M cmd/juju/status_test.go View 2 chunks +2 lines, -1 line 0 comments Download
M constraints/constraints.go View 1 2 5 chunks +61 lines, -0 lines 5 comments Download
M constraints/constraints_test.go View 6 chunks +44 lines, -6 lines 2 comments Download
M instance/instance.go View 1 2 1 chunk +34 lines, -0 lines 6 comments Download
A instance/instance_test.go View 1 2 1 chunk +35 lines, -0 lines 2 comments Download
M state/constraints.go View 1 chunk +16 lines, -12 lines 0 comments Download
M state/container.go View 1 chunk +0 lines, -12 lines 0 comments Download
M state/machine.go View 1 chunk +2 lines, -2 lines 0 comments Download
M state/state.go View 1 2 2 chunks +6 lines, -1 line 2 comments Download
M state/watcher.go View 3 chunks +3 lines, -2 lines 0 comments Download

Messages

Total messages: 11
wallyworld
Please take a look.
10 years, 10 months ago (2013-06-25 08:24:03 UTC) #1
fwereade
I think we might need some thought about what happens in state -- I think ...
10 years, 10 months ago (2013-06-26 14:10:01 UTC) #2
wallyworld
On 2013/06/26 14:10:01, fwereade wrote: > I think we might need some thought about what ...
10 years, 10 months ago (2013-06-27 13:58:58 UTC) #3
dimitern
diff is screwed, please repropose
10 years, 10 months ago (2013-06-27 14:28:17 UTC) #4
wallyworld
Please take a look.
10 years, 10 months ago (2013-06-27 14:30:31 UTC) #5
dimitern
Looks good, LGTM with fwereade's concerns fixed.
10 years, 10 months ago (2013-06-27 15:12:44 UTC) #6
wallyworld
We need to store the container constraint value in the environment constraints so that it ...
10 years, 10 months ago (2013-06-28 01:43:09 UTC) #7
wallyworld
Please take a look.
10 years, 10 months ago (2013-06-28 01:45:38 UTC) #8
fwereade
LGTM, just a couple of notes: https://codereview.appspot.com/10534043/diff/23001/constraints/constraints.go File constraints/constraints.go (left): https://codereview.appspot.com/10534043/diff/23001/constraints/constraints.go#oldcode155 constraints/constraints.go:155: } Please make ...
10 years, 10 months ago (2013-06-28 12:38:21 UTC) #9
thumper
LGTM - with a few suggestions moving the container bits in instance package to their ...
10 years, 10 months ago (2013-06-30 22:46:54 UTC) #10
wallyworld
10 years, 10 months ago (2013-07-01 01:09:59 UTC) #11
https://codereview.appspot.com/10534043/diff/23001/constraints/constraints.go
File constraints/constraints.go (left):

https://codereview.appspot.com/10534043/diff/23001/constraints/constraints.go...
constraints/constraints.go:155: }
On 2013/06/30 22:46:54, thumper wrote:
> On 2013/06/28 12:38:21, fwereade wrote:
> > Please make the ordering of the fields and their handling consistent. I'd
> > recommend alphabetical but any scheme's fine really so long as it's applied
> > consistently.
> 
> +1 on alphabetical

Done.

https://codereview.appspot.com/10534043/diff/23001/constraints/constraints.go
File constraints/constraints.go (right):

https://codereview.appspot.com/10534043/diff/23001/constraints/constraints.go...
constraints/constraints.go:207: v.Container = &ctype
On 2013/06/28 12:38:21, fwereade wrote:
> Is this an indication that the domain here is larger than that of
ContainerType,
> and that it might be better to just store it as a *string on Value? YMMV, I
> don't know which is best myself, and I'm a bit suspicious of my own
motivations
> in suggesting it.

This wouldn't be an issue if we used getters (or Python). I'd rather that when
people type cons.ContainerType they get a value of the correct type, even if it
means we have a few internal implementation complications.

https://codereview.appspot.com/10534043/diff/23001/constraints/constraints_te...
File constraints/constraints_test.go (right):

https://codereview.appspot.com/10534043/diff/23001/constraints/constraints_te...
constraints/constraints_test.go:51: args:    []string{"container="},
On 2013/06/30 22:46:54, thumper wrote:
> I'd really like to see "container=none" to be internally handled as
> "container=".
> 
> I think setting to none is more understandable to a user than setting to the
> empty string.
> 
> What do you think?

Thanks for mentioning this. "container=" is like saying "arch=" ie we don't
care. I did add a new container type "none", but forgot to add a test for it.

https://codereview.appspot.com/10534043/diff/23001/instance/instance.go
File instance/instance.go (right):

https://codereview.appspot.com/10534043/diff/23001/instance/instance.go#newco...
instance/instance.go:11: type ContainerType string
On 2013/06/30 22:46:54, thumper wrote:
> I'm a fan of smaller files.  Can we put the container related stuff into
> instance/container.go ?

Done.

https://codereview.appspot.com/10534043/diff/23001/instance/instance.go#newco...
instance/instance.go:24: // ParseSupportedContainerType converts the specified
string into a supported
On 2013/06/30 22:46:54, thumper wrote:
> On 2013/06/28 12:38:21, fwereade wrote:
> > OrNone
> 
> It took me a few minutes to parse the above comment.  The method name at the
> start of the comment doesn't match the method name.

Done.

https://codereview.appspot.com/10534043/diff/23001/instance/instance_test.go
File instance/instance_test.go (right):

https://codereview.appspot.com/10534043/diff/23001/instance/instance_test.go#...
instance/instance_test.go:1: // Copyright 2013 Canonical Ltd.
On 2013/06/30 22:46:54, thumper wrote:
> and container_test.go

Done.

https://codereview.appspot.com/10534043/diff/23001/state/state.go
File state/state.go (right):

https://codereview.appspot.com/10534043/diff/23001/state/state.go#newcode293
state/state.go:293: // clearing it avoids potential confusion.
On 2013/06/30 22:46:54, thumper wrote:
> The pedant in me says you should make the comment justified :-)
> 
> In emacs this is meta-q

I did it like this deliberately. I wanted the top line to stand alone.
Sign in to reply to this message.

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