|
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)
Total comments: 22
|
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
|
Total messages: 10
|