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

Issue 70190050: Update and Validate Environ Config in State

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 1 month ago by waigani
Modified:
10 years, 1 month ago
Reviewers:
axw, mp+209569
Visibility:
Public.

Description

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)

Patch Set 1 #

Total comments: 19

Patch Set 2 : Update and validate environ config in state #

Patch Set 3 : Update and Validate Environ Config in State #

Patch Set 4 : Update and Validate Environ Config in State #

Total comments: 40

Patch Set 5 : Update and Validate Environ Config in State #

Total comments: 29

Patch Set 6 : Update and Validate Environ Config in State #

Total comments: 20

Patch Set 7 : Update and Validate Environ Config in State #

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

Messages

Total messages: 16
axw
Some preliminary comments. I've only really looked at state.go. https://codereview.appspot.com/70190050/diff/1/state/state.go File state/state.go (left): https://codereview.appspot.com/70190050/diff/1/state/state.go#oldcode282 state/state.go:282: ...
10 years, 1 month ago (2014-03-06 04:19:16 UTC) #1
waigani
https://codereview.appspot.com/70190050/diff/1/state/state.go File state/state.go (left): https://codereview.appspot.com/70190050/diff/1/state/state.go#oldcode282 state/state.go:282: _, err = settings.Write() On 2014/03/06 04:19:17, axw wrote: ...
10 years, 1 month ago (2014-03-06 08:17:47 UTC) #2
axw
https://codereview.appspot.com/70190050/diff/1/state/state.go File state/state.go (left): https://codereview.appspot.com/70190050/diff/1/state/state.go#oldcode282 state/state.go:282: _, err = settings.Write() On 2014/03/06 08:17:48, waigani wrote: ...
10 years, 1 month ago (2014-03-06 08:34:44 UTC) #3
waigani
Please take a look.
10 years, 1 month ago (2014-03-07 23:28:49 UTC) #4
waigani
Please take a look.
10 years, 1 month ago (2014-03-07 23:36:00 UTC) #5
waigani
Please take a look.
10 years, 1 month ago (2014-03-07 23:45:07 UTC) #6
axw
I haven't reviewed everything, this should keep you going for a while though. In general: ...
10 years, 1 month ago (2014-03-10 03:41:53 UTC) #7
waigani
Please take a look. https://codereview.appspot.com/70190050/diff/60001/cmd/juju/environment.go File cmd/juju/environment.go (right): https://codereview.appspot.com/70190050/diff/60001/cmd/juju/environment.go#newcode166 cmd/juju/environment.go:166: return conn.State.UpdateEnvironConfig(c.values, []string{}) On 2014/03/10 ...
10 years, 1 month ago (2014-03-13 01:02:02 UTC) #8
waigani
Yikes. I really dug a hole for myself with such a big branch. I've finally ...
10 years, 1 month ago (2014-03-13 01:02:21 UTC) #9
axw
Getting there. https://codereview.appspot.com/70190050/diff/60001/state/apiserver/keymanager/keymanager.go File state/apiserver/keymanager/keymanager.go (left): https://codereview.appspot.com/70190050/diff/60001/state/apiserver/keymanager/keymanager.go#oldcode311 state/apiserver/keymanager/keymanager.go:311: // For now, authorised keys are global, ...
10 years, 1 month ago (2014-03-13 03:07:13 UTC) #10
waigani
Please take a look. https://codereview.appspot.com/70190050/diff/60001/worker/environ_test.go File worker/environ_test.go (left): https://codereview.appspot.com/70190050/diff/60001/worker/environ_test.go#oldcode49 worker/environ_test.go:49: // Create an invalid config ...
10 years, 1 month ago (2014-03-17 09:31:34 UTC) #11
waigani
10 years, 1 month ago (2014-03-17 09:33:11 UTC) #12
axw
A few minor things, then it should be good to land. https://codereview.appspot.com/70190050/diff/100001/environs/statepolicy.go File environs/statepolicy.go (right): ...
10 years, 1 month ago (2014-03-17 12:15:56 UTC) #13
waigani
Please take a look. https://codereview.appspot.com/70190050/diff/100001/environs/statepolicy.go File environs/statepolicy.go (right): https://codereview.appspot.com/70190050/diff/100001/environs/statepolicy.go#newcode43 environs/statepolicy.go:43: return provider.(state.ConfigValidator), nil On 2014/03/17 ...
10 years, 1 month ago (2014-03-17 22:45:52 UTC) #14
waigani
10 years, 1 month ago (2014-03-17 22:48:37 UTC) #15
axw
10 years, 1 month ago (2014-03-18 02:23:41 UTC) #16
On 2014/03/17 22:48:37, waigani wrote:

LGTM. Thanks for slogging through it.
Sign in to reply to this message.

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