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

Issue 86010044: various: Add network tags from names; provider id (Closed)

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

Description

various: Add network tags from names; provider id Fixes #1304905: Networks now have juju names used to identify them, and construct tags from that for the API, provider-specific id (currently the same as the name, but is a distinct field). Comments updated to better explain the difference between juju-specific network names and provider- specific ones (at present both are the same, but this will change). Few drive-by fixes are included as well. https://code.launchpad.net/~dimitern/juju-core/394-network-name-to-id-and-add-tags/+merge/214962 Requires: https://code.launchpad.net/~dimitern/juju-core/393-provisioner-allow-adding-networks/+merge/214720 (do not edit description out of merge proposal)

Patch Set 1 #

Patch Set 2 : various: Change NetworkName->Id, add network tags #

Total comments: 17

Patch Set 3 : various: Add network tags from names; provider id #

Total comments: 73

Patch Set 4 : various: Add network tags from names; provider id #

Patch Set 5 : various: Add network tags from names; provider id #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+650 lines, -221 lines) Patch
A [revision details] View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
M cmd/juju/deploy.go View 2 chunks +2 lines, -2 lines 0 comments Download
M environs/broker.go View 1 2 3 1 chunk +19 lines, -4 lines 0 comments Download
M errors/errors.go View 1 2 3 chunks +4 lines, -5 lines 0 comments Download
M errors/errors_test.go View 1 2 3 chunks +9 lines, -0 lines 0 comments Download
A names/network.go View 1 2 3 1 chunk +24 lines, -0 lines 0 comments Download
A names/network_test.go View 1 2 1 chunk +52 lines, -0 lines 0 comments Download
M names/tag.go View 3 chunks +3 lines, -0 lines 0 comments Download
M names/tag_test.go View 3 chunks +13 lines, -1 line 0 comments Download
M provider/dummy/environs.go View 1 2 1 chunk +6 lines, -1 line 0 comments Download
M provider/maas/environ.go View 1 2 2 chunks +3 lines, -2 lines 0 comments Download
M state/addmachine.go View 1 2 1 chunk +4 lines, -4 lines 0 comments Download
M state/address.go View 1 2 3 2 chunks +9 lines, -2 lines 0 comments Download
M state/api/client.go View 1 2 3 1 chunk +3 lines, -2 lines 0 comments Download
M state/api/params/internal.go View 1 2 3 2 chunks +25 lines, -9 lines 0 comments Download
M state/api/provisioner/machine.go View 1 2 2 chunks +2 lines, -2 lines 0 comments Download
M state/api/provisioner/provisioner_test.go View 1 2 3 chunks +29 lines, -20 lines 0 comments Download
M state/apiserver/client/client.go View 1 2 3 chunks +25 lines, -3 lines 0 comments Download
M state/apiserver/client/client_test.go View 1 1 chunk +10 lines, -1 line 0 comments Download
M state/apiserver/provisioner/provisioner.go View 1 2 3 4 3 chunks +51 lines, -7 lines 0 comments Download
M state/apiserver/provisioner/provisioner_test.go View 1 2 4 chunks +30 lines, -22 lines 0 comments Download
M state/machine.go View 1 2 3 4 5 chunks +29 lines, -19 lines 0 comments Download
M state/machine_test.go View 1 2 3 4 10 chunks +85 lines, -52 lines 0 comments Download
M state/networkinterfaces.go View 1 2 3 4 3 chunks +35 lines, -3 lines 0 comments Download
M state/networkinterfaces_test.go View 1 2 2 chunks +3 lines, -1 line 0 comments Download
M state/networks.go View 1 2 3 4 3 chunks +32 lines, -5 lines 0 comments Download
M state/networks_test.go View 1 2 1 chunk +4 lines, -2 lines 0 comments Download
M state/open.go View 1 2 3 4 3 chunks +13 lines, -10 lines 0 comments Download
M state/state.go View 1 2 3 6 chunks +41 lines, -16 lines 2 comments Download
M state/state_test.go View 1 2 8 chunks +69 lines, -18 lines 0 comments Download
M worker/provisioner/provisioner_task.go View 1 2 3 1 chunk +8 lines, -6 lines 0 comments Download
M worker/provisioner/provisioner_test.go View 1 2 3 chunks +6 lines, -2 lines 0 comments Download

Messages

Total messages: 13
dimitern
Please take a look.
9 years, 11 months ago (2014-04-09 14:34:13 UTC) #1
dimitern
Please take a look.
9 years, 11 months ago (2014-04-09 14:44:46 UTC) #2
fwereade
At least one of us is confused... possibly both. Hopefully these comments will elucidate where ...
9 years, 11 months ago (2014-04-09 15:34:48 UTC) #3
dimitern
Please take a look. https://codereview.appspot.com/86010044/diff/20001/names/network_test.go File names/network_test.go (right): https://codereview.appspot.com/86010044/diff/20001/names/network_test.go#newcode23 names/network_test.go:23: c.Assert(names.IsNetwork("42"), jc.IsTrue) On 2014/04/09 15:34:48, ...
9 years, 11 months ago (2014-04-10 14:44:36 UTC) #4
rog
Looks good in general with a bunch of comments and questions. I'd like it if ...
9 years, 11 months ago (2014-04-10 15:48:10 UTC) #5
fwereade
Looking very good, but I think the txn bits need a bit of work; and ...
9 years, 11 months ago (2014-04-11 11:09:35 UTC) #6
dimitern
Please take a look. https://codereview.appspot.com/86010044/diff/30001/environs/broker.go File environs/broker.go (right): https://codereview.appspot.com/86010044/diff/30001/environs/broker.go#newcode38 environs/broker.go:38: // available at StartInstance() time. ...
9 years, 11 months ago (2014-04-11 14:05:04 UTC) #7
fwereade
would be nice to s/Params/Info/ as discussed live; otherwise LGTM
9 years, 11 months ago (2014-04-11 14:37:06 UTC) #8
dimitern
Please take a look.
9 years, 11 months ago (2014-04-11 15:14:06 UTC) #9
fwereade
On 2014/04/11 15:14:06, dimitern wrote: > Please take a look. Except, wait, we never fixed ...
9 years, 11 months ago (2014-04-13 20:20:55 UTC) #10
dimitern
On 2014/04/13 20:20:55, fwereade wrote: > On 2014/04/11 15:14:06, dimitern wrote: > > Please take ...
9 years, 11 months ago (2014-04-14 07:07:54 UTC) #11
rog
Sorry, I know this is already merged, but I still have a few comments. https://codereview.appspot.com/86010044/diff/30001/state/machine.go ...
9 years, 11 months ago (2014-04-14 07:52:07 UTC) #12
dimitern
9 years, 11 months ago (2014-04-14 08:29:07 UTC) #13
Message was sent while issue was closed.
https://codereview.appspot.com/86010044/diff/30001/state/machine.go
File state/machine.go (right):

https://codereview.appspot.com/86010044/diff/30001/state/machine.go#newcode1018
state/machine.go:1018: func (m *Machine) AddNetworkInterface(macAddress,
interfaceName, networkName string) (iface *NetworkInterface, err error) {
On 2014/04/14 07:52:07, rog wrote:
> On 2014/04/11 14:05:04, dimitern wrote:
> > On 2014/04/10 15:48:10, rog wrote:
> > > It seems a bit odd to me that we're specifying os-specific interface names
> (if
> > > that's what interfaceName is) in the state, but I guess this has already
> been
> > > thrashed out already. I guess I'd have expected the machine to choose its
> > > interface names for itself.
> > 
> > We need the interface names to be OS-specific, because that's how we can
> > discover, refer to, and manage them on the machine.
> 
> Is it always the machine itself that calls AddNetworkInterface?

The provisioner task that starts the instance for machine m is the one that
calls m.AddNetworkInterface at the moment. This could change in the future as we
can manage networks independently of provisioning.

https://codereview.appspot.com/86010044/diff/30001/state/machine.go#newcode1052
state/machine.go:1052: for i := 0; i < 5; i++ {
On 2014/04/14 07:52:07, rog wrote:
> On 2014/04/11 14:05:04, dimitern wrote:
> > On 2014/04/10 15:48:10, rog wrote:
> > > similar question to State.AddNetwork, why are we iterating here?
> > 
> > See answer above.
> 
> I still don't see it. If the transaction fails because the machine
> is now dead, how will iterating help matters? (the machine is
> still going to be dead no matter how many times we try).
> 
> Similarly, a machine cannot be unprovisioned once it's provisioned.
> 
> Why are we iterating, again?

Fair enough, I'll fix this and remove the loop in a follow-up.

https://codereview.appspot.com/86010044/diff/30001/state/machine.go#newcode1072
state/machine.go:1072: // For some reason when using unique indices with mgo,
and
On 2014/04/14 07:52:07, rog wrote:
> The comment sounds like we don't know what's going on, but we
> do know, so I think the comment could be better.
> 
> // We have a unique key restriction on the InterfaceName
> // field, which will cause the insert to fail if there
> // is another record with the same interface name in the
> // table. The txn logic does not report insertion errors,
> // so we check that the record has actually been inserted
> // correctly before reporting success.
> 
> ?

Done in a follow-up. And yes, it *does* sound like that - this specific behavior
of mgo/txn is not documented anywhere!

https://codereview.appspot.com/86010044/diff/70001/state/state.go
File state/state.go (right):

https://codereview.appspot.com/86010044/diff/70001/state/state.go#newcode1063
state/state.go:1063: // For some reason when using unique indices with mgo, and
On 2014/04/14 07:52:07, rog wrote:
> I'd suggest a similar comment here to my suggestion elsewhere.

Done in a follow-up.
Sign in to reply to this message.

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