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

Issue 85590044: Various address logic fixes

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years ago by axw
Modified:
10 years ago
Reviewers:
gz, mp+215085, rog
Visibility:
Public.

Description

Various address logic fixes - Unified logic for Select{Public,Internal}Address. Now they both return the first public/private address, or the first address with a usable scope. - instance.NewAddress will now derive the scope of IPv4 address from the network range. Loopback addresses are machine-local, private network addresses are cloud- local, all others are public. - Now using instance.NewAddress in provider/openstack and worker/machiner so scope derivation logic is used. Live-tested on HP Cloud and Canonistack. - Dropped instance.HostAddresses; it is no longer used. - Fixed state.mergedAddresses to maintain order. Fixes lp:1303735 https://code.launchpad.net/~axwalk/juju-core/lp1303735-fix-address-logic/+merge/215085 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 8

Patch Set 2 : Various address logic fixes #

Total comments: 11

Patch Set 3 : Various address logic fixes #

Patch Set 4 : Various address logic fixes #

Unified diffs Side-by-side diffs Delta from patch set Stats (+284 lines, -198 lines) Patch
A [revision details] View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M cmd/juju/status_test.go View 3 chunks +3 lines, -3 lines 0 comments Download
M instance/address.go View 1 4 chunks +133 lines, -90 lines 0 comments Download
M instance/address_test.go View 5 chunks +49 lines, -49 lines 0 comments Download
M provider/common/state.go View 1 chunk +0 lines, -1 line 0 comments Download
M provider/maas/instance.go View 1 chunk +1 line, -1 line 0 comments Download
M provider/openstack/provider.go View 1 2 1 chunk +4 lines, -6 lines 0 comments Download
M provider/openstack/provider_test.go View 1 2 3 2 chunks +8 lines, -8 lines 0 comments Download
M state/api/machiner/machiner_test.go View 2 chunks +2 lines, -1 line 0 comments Download
M state/api/state.go View 1 chunk +2 lines, -6 lines 0 comments Download
M state/apiserver/machine/machiner.go View 1 chunk +1 line, -1 line 0 comments Download
M state/machine.go View 3 chunks +15 lines, -13 lines 0 comments Download
M state/machine_test.go View 1 chunk +30 lines, -1 line 0 comments Download
M state/unit_test.go View 1 chunk +25 lines, -0 lines 0 comments Download
M worker/machiner/machiner.go View 1 chunk +1 line, -8 lines 0 comments Download
M worker/machiner/machiner_test.go View 2 chunks +6 lines, -4 lines 0 comments Download
M worker/peergrouper/worker_test.go View 1 chunk +2 lines, -6 lines 0 comments Download

Messages

Total messages: 7
axw
Please take a look.
10 years ago (2014-04-10 06:54:29 UTC) #1
rog
Nice, LGTM. https://codereview.appspot.com/85590044/diff/1/instance/address.go File instance/address.go (right): https://codereview.appspot.com/85590044/diff/1/instance/address.go#newcode34 instance/address.go:34: Ipv4Address AddressType = "ipv4" It would be ...
10 years ago (2014-04-10 07:31:08 UTC) #2
axw
Please take a look. https://codereview.appspot.com/85590044/diff/1/instance/address.go File instance/address.go (right): https://codereview.appspot.com/85590044/diff/1/instance/address.go#newcode34 instance/address.go:34: Ipv4Address AddressType = "ipv4" On ...
10 years ago (2014-04-10 08:13:31 UTC) #3
gz
LGTM. Only one real thing to fix, and some other general comments. https://codereview.appspot.com/85590044/diff/20001/instance/address.go File instance/address.go ...
10 years ago (2014-04-10 11:23:27 UTC) #4
axw
Please take a look. https://codereview.appspot.com/85590044/diff/20001/provider/openstack/provider.go File provider/openstack/provider.go (left): https://codereview.appspot.com/85590044/diff/20001/provider/openstack/provider.go#oldcode419 provider/openstack/provider.go:419: NetworkName: network, On 2014/04/10 11:23:27, ...
10 years ago (2014-04-10 11:57:54 UTC) #5
gz
LGTM. https://codereview.appspot.com/85590044/diff/20001/provider/openstack/provider_test.go File provider/openstack/provider_test.go (left): https://codereview.appspot.com/85590044/diff/20001/provider/openstack/provider_test.go#oldcode63 provider/openstack/provider_test.go:63: private: []nova.IPAddress{{4, "127.0.0.4"}, {4, "8.8.4.4"}}, On 2014/04/10 11:57:54, ...
10 years ago (2014-04-10 12:20:04 UTC) #6
axw
10 years ago (2014-04-10 13:22:24 UTC) #7
Please take a look.

https://codereview.appspot.com/85590044/diff/20001/provider/openstack/provide...
File provider/openstack/provider_test.go (left):

https://codereview.appspot.com/85590044/diff/20001/provider/openstack/provide...
provider/openstack/provider_test.go:63: private:  []nova.IPAddress{{4,
"127.0.0.4"}, {4, "8.8.4.4"}},
On 2014/04/10 12:20:04, gz wrote:
> On 2014/04/10 11:57:54, axw wrote:
> > On 2014/04/10 11:23:27, gz wrote:
> > > And this is the real world example (mostly, not sure why I used a 127.
> address
> > > not a 10. address) we expect to work... I'm not sure about your changes to
> > this
> > > test? The code should still pick the 8. address if a non-public one is
> first,
> > > due to the private address range matching?
> > 
> > I changed it because 127.0.0.4 is machine-local, and hence will never match.
> > Likewise for the other test changes.
> 
> So, specifically, the test should be (and should work as) {"10.0.0.1",
> "8.8.4.4"} -> "8.8.4.4".

Done.
Sign in to reply to this message.

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