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

Issue 63790045: State policy based config validation.

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 2 months ago by waigani
Modified:
10 years, 2 months ago
Reviewers:
mp+207586, axw, fwereade
Visibility:
Public.

Description

State policy based config validation. First pass at using state policy to preform environ specific config validations. https://code.launchpad.net/~waigani/juju-core/trunk/+merge/207586 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 7

Patch Set 2 : State policy based config validation. #

Patch Set 3 : State policy based config validation. #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+152 lines, -14 lines) Patch
A [revision details] View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M environs/statepolicy.go View 1 1 chunk +13 lines, -0 lines 0 comments Download
M state/apiserver/client/client.go View 1 1 chunk +2 lines, -12 lines 1 comment Download
A state/configvalidator_test.go View 1 2 1 chunk +92 lines, -0 lines 0 comments Download
M state/conn_test.go View 2 chunks +9 lines, -1 line 0 comments Download
M state/policy.go View 1 3 chunks +28 lines, -0 lines 1 comment Download
M state/state.go View 1 2 chunks +6 lines, -1 line 2 comments Download

Messages

Total messages: 6
waigani
Please take a look.
10 years, 2 months ago (2014-02-21 03:42:06 UTC) #1
axw
Preliminary comments. I think it'd be a good idea to tone back the changes to ...
10 years, 2 months ago (2014-02-21 04:07:35 UTC) #2
waigani
Please take a look.
10 years, 2 months ago (2014-02-21 09:37:19 UTC) #3
axw
On 2014/02/21 09:37:19, waigani wrote: > Please take a look. Implementations looks good, but please ...
10 years, 2 months ago (2014-02-21 09:44:47 UTC) #4
waigani
Please take a look.
10 years, 2 months ago (2014-02-23 05:04:45 UTC) #5
fwereade
10 years, 2 months ago (2014-02-27 13:36:33 UTC) #6
LGTM assuming there's a followup in which my comments are, or will be,
addressed. Progress not perfection :).

https://codereview.appspot.com/63790045/diff/40001/state/apiserver/client/cli...
File state/apiserver/client/client.go (right):

https://codereview.appspot.com/63790045/diff/40001/state/apiserver/client/cli...
state/apiserver/client/client.go:791: }
Shouldn't all this code above here move into state? If we're using oldConfig as
a base we need to assert that the base really is oldConfig, and handle
state-changed in here, and have a retry loop in here, etc.

https://codereview.appspot.com/63790045/diff/40001/state/policy.go
File state/policy.go (right):

https://codereview.appspot.com/63790045/diff/40001/state/policy.go#newcode81
state/policy.go:81: configValidator, err := st.policy.ConfigValidator(cfg)
if this just depends on type, can we make it explicit and pass in the type? I'm
just a bit twitchy about seeing cfg passed in twice.

https://codereview.appspot.com/63790045/diff/40001/state/state.go
File state/state.go (right):

https://codereview.appspot.com/63790045/diff/40001/state/state.go#newcode261
state/state.go:261: func (st *State) SetEnvironConfig(cfg, old *config.Config)
error {
yeah, passing in old here really makes no sense. If we're applying a delta, it
should be a delta all the way; the old/new stuff is purely to validate that
delta.

If there's a followup addressing this then feel free to address this stuff
there, though, it's not like this implementation is any worse ;).

https://codereview.appspot.com/63790045/diff/40001/state/state.go#newcode283
state/state.go:283: settings.Delete(k)
I tried to resist the urge to say this again, but, gaah, this is all messed up.
This is not a comment on your branch.
Sign in to reply to this message.

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