APIHostPorts returns 'localhost' and '127.0.0.1'
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
juju-core |
Fix Released
|
High
|
Martin Packman |
Bug Description
My ~/.juju/
- 54.216.90.129:17070
- ec2-54-
- ip-10-72-
- 10.72.129.222:17070
- 127.0.0.1:17070
- '[::1]:17070'
- '[fe80:
- ec2-79-
- ip-10-33-
- 79.125.48.125:17070
- 10.33.183.137:17070
- 127.0.0.1:17070
- '[::1]:17070'
- '[fe80:
- ec2-54-
- ip-10-73-
- 54.217.146.81:17070
- 10.73.128.8:17070
- 127.0.0.1:17070
- '[::1]:17070'
- '[fe80:
while it is odd to have both the EC2 DNS name and the raw IP address listed, I feel it is just wrong to be listing ::1 and 127.0.0.1
The only place those are valid is on the state servers themselves, and there we should be hard-coding "connect only to the local address" so that we don't end up with machine-1 as a state server making all its requests against machine-0's API.
(It probably needs to connect to machine-0 to verify it *is* still considered an API server, but once that finishes it should start its own service and stop connecting to the other machine.)
Related branches
- Juju Engineering: Pending requested
-
Diff: 59 lines (+40/-1)2 files modifiedjuju/api.go (+5/-1)
juju/apiconn_test.go (+35/-0)
Changed in juju-core: | |
assignee: | nobody → Martin Packman (gz) |
Changed in juju-core: | |
status: | Triaged → Fix Committed |
Changed in juju-core: | |
status: | Fix Committed → Fix Released |
Note we also have bug #1308491 that we should be caching the full contents of HostPorts and not just the final Addr. That would potentially let us filter late instead of early. But it still seems wrong to have APIHostPorts() return localhost.