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

Issue 81570043: agent: safer and more flexible

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 1 month ago by rog
Modified:
10 years, 1 month ago
Reviewers:
wwitzel3, dimitern, mp+213134, fwereade
Visibility:
Public.

Description

agent: safer and more flexible For the machine agent, we need a way of safely updating the agent configuration from multiple places. The singleton approach wasn't cutting it, and isn't very Go like (communicating by sharing memory n' all). So we change agent.Config to split out setting and writing methods, so that the majority of places that use it can use read-only methods. We add a Clone method to make it possible to pass around a read-only copy of a mutable config. We also factor out some methods that are really behavioural and not directly to do with Config (except that they use information from the Config). This means that any config changes they make can be made under control of external code. https://code.launchpad.net/~rogpeppe/juju-core/533-agent-config-safety/+merge/213134 (do not edit description out of merge proposal)

Patch Set 1 #

Patch Set 2 : agent: safer and more flexible #

Total comments: 22

Patch Set 3 : agent: safer and more flexible #

Unified diffs Side-by-side diffs Delta from patch set Stats (+616 lines, -543 lines) Patch
A [revision details] View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M agent/agent.go View 1 2 14 chunks +169 lines, -223 lines 0 comments Download
M agent/agent_test.go View 1 2 7 chunks +79 lines, -101 lines 0 comments Download
M agent/bootstrap.go View 5 chunks +16 lines, -15 lines 0 comments Download
M agent/bootstrap_test.go View 3 chunks +8 lines, -5 lines 0 comments Download
M agent/export_test.go View 1 chunk +0 lines, -4 lines 0 comments Download
M agent/format-1.16_whitebox_test.go View 2 chunks +3 lines, -3 lines 0 comments Download
M agent/format-1.18_whitebox_test.go View 2 chunks +2 lines, -2 lines 0 comments Download
M agent/format_whitebox_test.go View 1 chunk +1 line, -1 line 0 comments Download
M cmd/jujud/agent.go View 1 2 7 chunks +85 lines, -36 lines 0 comments Download
M cmd/jujud/agent_test.go View 1 2 7 chunks +63 lines, -33 lines 0 comments Download
M cmd/jujud/bootstrap.go View 4 chunks +26 lines, -11 lines 0 comments Download
M cmd/jujud/bootstrap_test.go View 2 chunks +3 lines, -3 lines 0 comments Download
M cmd/jujud/machine.go View 1 2 19 chunks +109 lines, -67 lines 0 comments Download
M cmd/jujud/machine_test.go View 4 chunks +6 lines, -4 lines 0 comments Download
M cmd/jujud/unit.go View 7 chunks +7 lines, -12 lines 0 comments Download
M cmd/jujud/unit_test.go View 1 2 2 chunks +7 lines, -5 lines 0 comments Download
M cmd/jujud/upgrade_test.go View 1 chunk +1 line, -1 line 0 comments Download
M environs/cloudinit/cloudinit.go View 1 chunk +1 line, -1 line 0 comments Download
M upgrades/agentconfig.go View 1 chunk +2 lines, -3 lines 0 comments Download
M upgrades/agentconfig_test.go View 1 8 chunks +17 lines, -4 lines 0 comments Download
M upgrades/upgrade.go View 3 chunks +4 lines, -4 lines 0 comments Download
M upgrades/upgrade_test.go View 3 chunks +3 lines, -3 lines 0 comments Download
M worker/deployer/simple_test.go View 1 chunk +1 line, -1 line 0 comments Download
M worker/provisioner/lxc-broker_test.go View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 10
rog
Please take a look.
10 years, 1 month ago (2014-03-27 20:20:33 UTC) #1
fwereade
Looking very nice indeed, but a few comments follow: https://codereview.appspot.com/81570043/diff/20001/agent/agent_test.go File agent/agent_test.go (right): https://codereview.appspot.com/81570043/diff/20001/agent/agent_test.go#newcode411 agent/agent_test.go:411: ...
10 years, 1 month ago (2014-03-27 21:20:32 UTC) #2
rog
https://codereview.appspot.com/81570043/diff/20001/agent/agent_test.go File agent/agent_test.go (right): https://codereview.appspot.com/81570043/diff/20001/agent/agent_test.go#newcode411 agent/agent_test.go:411: c.Assert(conf.StateInfo(), gc.DeepEquals, expectStateInfo) On 2014/03/27 21:20:32, fwereade wrote: > ...
10 years, 1 month ago (2014-03-28 08:29:58 UTC) #3
dimitern
A few comments. https://codereview.appspot.com/81570043/diff/20001/agent/agent_test.go File agent/agent_test.go (right): https://codereview.appspot.com/81570043/diff/20001/agent/agent_test.go#newcode259 agent/agent_test.go:259: c.Assert(agent.ConfigFileExists(newConfig), jc.IsTrue) Why drop the check ...
10 years, 1 month ago (2014-03-28 08:59:36 UTC) #4
rog
https://codereview.appspot.com/81570043/diff/20001/agent/agent_test.go File agent/agent_test.go (right): https://codereview.appspot.com/81570043/diff/20001/agent/agent_test.go#newcode259 agent/agent_test.go:259: c.Assert(agent.ConfigFileExists(newConfig), jc.IsTrue) On 2014/03/28 08:59:36, dimitern wrote: > Why ...
10 years, 1 month ago (2014-03-28 09:11:06 UTC) #5
dimitern
LGTM, assuming you do a live test upgrading 1.16 to 1.18 and the agent config ...
10 years, 1 month ago (2014-03-28 09:28:50 UTC) #6
wwitzel3
LGTM with a question/suggestion and +1 dimitern https://codereview.appspot.com/81570043/diff/20001/cmd/jujud/machine.go File cmd/jujud/machine.go (right): https://codereview.appspot.com/81570043/diff/20001/cmd/jujud/machine.go#newcode313 cmd/jujud/machine.go:313: handler := ...
10 years, 1 month ago (2014-03-28 12:34:41 UTC) #7
fwereade
changes LGTM modulo: https://codereview.appspot.com/81570043/diff/20001/cmd/jujud/machine.go File cmd/jujud/machine.go (right): https://codereview.appspot.com/81570043/diff/20001/cmd/jujud/machine.go#newcode313 cmd/jujud/machine.go:313: handler := provisioner.NewContainerSetupHandler( On 2014/03/28 12:34:41, ...
10 years, 1 month ago (2014-03-28 13:16:34 UTC) #8
rog
Please take a look.
10 years, 1 month ago (2014-03-28 13:26:19 UTC) #9
rog
10 years, 1 month ago (2014-03-30 15:57:44 UTC) #10
On 2014/03/28 13:26:19, rog wrote:
> Please take a look.

Verified that upgrades work live. Uncovered
https://bugs.launchpad.net/juju-core/+bug/1299802
but since that also happens on trunk, it doesn't appear to be relevant to this
change.
Sign in to reply to this message.

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