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

Issue 82520043: agent: add ConfigSetterOnly.SetAPIHostPorts

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years ago by axw
Modified:
10 years ago
Reviewers:
dimitern, dfc, mp+213409, jameinel
Visibility:
Public.

Description

agent: add ConfigSetterOnly.SetAPIHostPorts We still only store addresses in the config, so we lose some metadata. We make use of the scope metadata before storing, though, to prune the addresses to the internal ones. https://code.launchpad.net/~axwalk/juju-core/agent-setapihostports/+merge/213409 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 5
Unified diffs Side-by-side diffs Delta from patch set Stats (+54 lines, -0 lines) Patch
A [revision details] View 1 chunk +2 lines, -0 lines 0 comments Download
M agent/agent.go View 3 chunks +18 lines, -0 lines 4 comments Download
M agent/agent_test.go View 2 chunks +34 lines, -0 lines 1 comment Download

Messages

Total messages: 7
axw
Please take a look.
10 years ago (2014-03-31 06:41:36 UTC) #1
dfc
https://codereview.appspot.com/82520043/diff/1/agent/agent_test.go File agent/agent_test.go (right): https://codereview.appspot.com/82520043/diff/1/agent/agent_test.go#newcode465 agent/agent_test.go:465: c.Assert(addrs, gc.DeepEquals, []string{"0.1.2.3:123", "0.1.2.5:125"}) Does conf.APIAddresses return a set ...
10 years ago (2014-03-31 06:44:02 UTC) #2
axw
On 2014/03/31 06:44:02, dfc wrote: > https://codereview.appspot.com/82520043/diff/1/agent/agent_test.go > File agent/agent_test.go (right): > > https://codereview.appspot.com/82520043/diff/1/agent/agent_test.go#newcode465 > ...
10 years ago (2014-03-31 07:24:44 UTC) #3
dfc
Fair enough. On Mon, Mar 31, 2014 at 6:24 PM, <axwalk@gmail.com> wrote: > On 2014/03/31 ...
10 years ago (2014-03-31 07:27:24 UTC) #4
dimitern
LGTM https://codereview.appspot.com/82520043/diff/1/agent/agent.go File agent/agent.go (right): https://codereview.appspot.com/82520043/diff/1/agent/agent.go#newcode432 agent/agent.go:432: return Why return here rather than creating apiDetails?
10 years ago (2014-03-31 11:57:11 UTC) #5
jameinel
This feels like an incorrect layer to be doing the validation of addresses. I won't ...
10 years ago (2014-03-31 12:26:15 UTC) #6
axw
10 years ago (2014-03-31 13:16:26 UTC) #7
https://codereview.appspot.com/82520043/diff/1/agent/agent.go
File agent/agent.go (right):

https://codereview.appspot.com/82520043/diff/1/agent/agent.go#newcode432
agent/agent.go:432: return
On 2014/03/31 11:57:11, dimitern wrote:
> Why return here rather than creating apiDetails?

Because apiDetails should be != nil if we're the API (i.e. always). We should
probably just error out if Addresses is empty in NewAgentConfig.

https://codereview.appspot.com/82520043/diff/1/agent/agent.go#newcode435
agent/agent.go:435: for _, serverHostPorts := range servers {
On 2014/03/31 12:26:15, jameinel wrote:
> It feels like the wrong layer for *configInternal* to be the thing that
decides
> that we save CloudLocal only addresses.
> 
> Shouldn't this be done in the layer *above* config, and config is just about
> "write this stuff to disk and read it back again" ?

You're right, I think, but I think it'd be unhelpful to change that now.
Eventually we should store [][]instance.HostPort in agent.conf, and then use
that in api.Open.
Sign in to reply to this message.

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