|
Update and Validate Environ Config in State
The main business logic happens in state/state.go. The bulk of the other
changes are mechanical i.e. updating method calls. There are a few things going on:
-Explicitly add/update or remove attributes with state.UpdateEnvironConf, which
replaces state.SetEnvironConf.
- Add ConfigValidator to state.Policy interface.
- Validate environment configuration within state.
- build new config from UpdateEnvironConf args, get old config from state.
- pass both configs to st.validate which use the environ policy
ConfigValidator to get the correct validation method.
- use the validated config to make the actual updates in state.
- Update or delete tests that rely on an invalid configuration being set, as
this is now not possible.
A follow up branch will use txn and a retry loop to address a race condition in
updating state config to ensure that concurrent updates to state config do not corrupt one
another.
https://code.launchpad.net/~waigani/juju-core/get-oldConfig-from-state/+merge/209569
(do not edit description out of merge proposal)
Total comments: 19
Total comments: 40
Total comments: 29
Total comments: 20
|
Unified diffs |
Side-by-side diffs |
Delta from patch set |
Stats (+477 lines, -413 lines) |
Patch |
 |
A |
[revision details]
|
View
|
1
2
3
4
5
6
|
1 chunk |
+2 lines, -0 lines |
0 comments
|
Download
|
 |
M |
cmd/juju/authorisedkeys_test.go
|
View
|
1
2
3
4
|
2 chunks |
+1 line, -2 lines |
0 comments
|
Download
|
 |
M |
cmd/juju/environment.go
|
View
|
1
2
3
4
|
1 chunk |
+2 lines, -20 lines |
0 comments
|
Download
|
 |
M |
cmd/juju/environment_test.go
|
View
|
1
2
3
4
5
|
2 chunks |
+2 lines, -1 line |
0 comments
|
Download
|
 |
M |
cmd/juju/upgradejuju_test.go
|
View
|
1
2
3
4
5
|
3 chunks |
+7 lines, -14 lines |
0 comments
|
Download
|
 |
M |
cmd/jujud/machine_test.go
|
View
|
1
2
3
4
5
|
3 chunks |
+3 lines, -8 lines |
0 comments
|
Download
|
 |
M |
environs/config.go
|
View
|
1
|
1 chunk |
+5 lines, -5 lines |
0 comments
|
Download
|
 |
M |
environs/config/config.go
|
View
|
1
2
3
4
5
|
1 chunk |
+9 lines, -0 lines |
0 comments
|
Download
|
 |
M |
environs/statepolicy.go
|
View
|
1
2
3
4
5
6
|
1 chunk |
+10 lines, -0 lines |
0 comments
|
Download
|
 |
M |
environs/testing/tools.go
|
View
|
1
2
3
4
5
|
1 chunk |
+1 line, -7 lines |
0 comments
|
Download
|
 |
M |
juju/conn.go
|
View
|
1
2
3
4
5
|
2 chunks |
+3 lines, -7 lines |
0 comments
|
Download
|
 |
M |
juju/conn_test.go
|
View
|
1
2
3
4
5
6
|
2 chunks |
+4 lines, -10 lines |
0 comments
|
Download
|
 |
M |
juju/testing/conn.go
|
View
|
1
|
2 chunks |
+5 lines, -1 line |
0 comments
|
Download
|
 |
M |
juju/testing/repo.go
|
View
|
1
2
3
4
|
1 chunk |
+2 lines, -5 lines |
0 comments
|
Download
|
 |
M |
juju/testing/utils.go
|
View
|
1
|
1 chunk |
+0 lines, -14 lines |
0 comments
|
Download
|
 |
M |
state/api/common/testing/environwatcher.go
|
View
|
1
2
3
4
5
6
|
1 chunk |
+16 lines, -7 lines |
0 comments
|
Download
|
 |
M |
state/api/firewaller/state_test.go
|
View
|
1
2
3
4
5
|
2 chunks |
+4 lines, -7 lines |
0 comments
|
Download
|
 |
M |
state/api/keymanager/client_test.go
|
View
|
1
2
3
4
5
|
2 chunks |
+1 line, -2 lines |
0 comments
|
Download
|
 |
M |
state/api/keyupdater/authorisedkeys_test.go
|
View
|
1
2
3
4
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
state/api/logger/logger_test.go
|
View
|
1
2
3
4
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
state/apiserver/client/client.go
|
View
|
1
2
3
4
|
1 chunk |
+15 lines, -30 lines |
0 comments
|
Download
|
 |
M |
state/apiserver/client/client_test.go
|
View
|
1
2
3
4
5
|
1 chunk |
+3 lines, -12 lines |
0 comments
|
Download
|
 |
M |
state/apiserver/keymanager/keymanager.go
|
View
|
1
2
3
4
5
|
11 chunks |
+21 lines, -21 lines |
0 comments
|
Download
|
 |
M |
state/apiserver/keymanager/keymanager_test.go
|
View
|
1
2
3
4
5
|
2 chunks |
+1 line, -2 lines |
0 comments
|
Download
|
 |
M |
state/apiserver/keyupdater/authorisedkeys_test.go
|
View
|
1
2
3
4
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
state/apiserver/logger/logger_test.go
|
View
|
1
2
3
4
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
state/apiserver/provisioner/provisioner_test.go
|
View
|
1
2
3
4
5
|
1 chunk |
+3 lines, -6 lines |
0 comments
|
Download
|
 |
M |
state/apiserver/rsyslog/rsyslog.go
|
View
|
1
2
3
4
|
1 chunk |
+2 lines, -10 lines |
0 comments
|
Download
|
 |
A |
state/configvalidator_test.go
|
View
|
1
2
3
4
|
1 chunk |
+114 lines, -0 lines |
0 comments
|
Download
|
 |
M |
state/conn_test.go
|
View
|
1
2
3
4
5
|
2 chunks |
+9 lines, -1 line |
0 comments
|
Download
|
 |
M |
state/initialize_test.go
|
View
|
1
2
3
4
5
|
2 chunks |
+5 lines, -5 lines |
0 comments
|
Download
|
 |
M |
state/machine_test.go
|
View
|
1
2
3
4
5
|
1 chunk |
+2 lines, -3 lines |
0 comments
|
Download
|
 |
M |
state/policy.go
|
View
|
|
3 chunks |
+28 lines, -0 lines |
0 comments
|
Download
|
 |
M |
state/state.go
|
View
|
1
2
3
4
5
6
|
2 chunks |
+48 lines, -10 lines |
0 comments
|
Download
|
 |
M |
state/state_test.go
|
View
|
1
2
3
4
5
6
|
6 chunks |
+50 lines, -19 lines |
0 comments
|
Download
|
 |
M |
state/testing/agent.go
|
View
|
1
2
3
4
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
state/testing/config.go
|
View
|
1
2
3
4
|
1 chunk |
+0 lines, -22 lines |
0 comments
|
Download
|
 |
M |
upgrades/deprecatedattributes.go
|
View
|
1
2
3
4
|
1 chunk |
+8 lines, -21 lines |
0 comments
|
Download
|
 |
M |
upgrades/deprecatedattributes_test.go
|
View
|
1
2
3
4
5
|
1 chunk |
+3 lines, -6 lines |
0 comments
|
Download
|
 |
M |
upgrades/rsyslogport.go
|
View
|
1
2
3
4
|
1 chunk |
+2 lines, -9 lines |
0 comments
|
Download
|
 |
M |
worker/authenticationworker/worker_test.go
|
View
|
1
2
3
4
|
2 chunks |
+1 line, -2 lines |
0 comments
|
Download
|
 |
M |
worker/environ_test.go
|
View
|
1
2
3
4
|
1 chunk |
+17 lines, -13 lines |
0 comments
|
Download
|
 |
M |
worker/firewaller/firewaller_test.go
|
View
|
1
|
9 chunks |
+17 lines, -38 lines |
0 comments
|
Download
|
 |
M |
worker/instancepoller/observer_test.go
|
View
|
1
2
3
4
|
3 chunks |
+12 lines, -15 lines |
0 comments
|
Download
|
 |
M |
worker/machineenvironmentworker/machineenvironmentworker_test.go
|
View
|
1
2
3
4
5
|
3 chunks |
+8 lines, -8 lines |
0 comments
|
Download
|
 |
M |
worker/provisioner/provisioner_test.go
|
View
|
1
2
3
4
5
6
|
7 chunks |
+23 lines, -39 lines |
0 comments
|
Download
|
 |
M |
worker/uniter/uniter_test.go
|
View
|
1
2
3
4
5
|
1 chunk |
+3 lines, -6 lines |
0 comments
|
Download
|
Total messages: 16
|