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

Issue 6416055: environs: split out config validation

Can't Edit
Can't Publish+Mail
Start Review
Created:
13 years, 7 months ago by niemeyer
Modified:
13 years, 7 months ago
Reviewers:
fwereade, mp+115879
Visibility:
Public.

Description

environs: split out config validation This enables the validation of environment configurations independently from the creation of environment instances. The way in which this was done facilitates: - the implementation of set-env - storage of validated and provider-enriched configs in state - provider-specific config change rejection https://code.launchpad.net/~niemeyer/juju-core/config-3000-validation/+merge/115879 Requires: https://code.launchpad.net/~niemeyer/juju-core/schema-field-map-defaults/+merge/115863 (do not edit description out of merge proposal)

Patch Set 1 #

Patch Set 2 : environs: split out config validation #

Patch Set 3 : environs: split out config validation #

Total comments: 6

Patch Set 4 : environs: split out config validation #

Total comments: 2

Patch Set 5 : environs: split out config validation #

Unified diffs Side-by-side diffs Delta from patch set Stats (+324 lines, -204 lines) Patch
A [revision details] View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
M environs/config/config.go View 1 chunk +9 lines, -0 lines 0 comments Download
M environs/config/config_test.go View 1 chunk +24 lines, -0 lines 0 comments Download
M environs/dummy/environs.go View 13 chunks +57 lines, -49 lines 0 comments Download
M environs/ec2/config.go View 1 2 3 2 chunks +61 lines, -40 lines 0 comments Download
M environs/ec2/config_test.go View 1 2 3 4 5 chunks +124 lines, -68 lines 0 comments Download
M environs/ec2/ec2.go View 7 chunks +43 lines, -39 lines 0 comments Download
M environs/interface.go View 2 chunks +3 lines, -3 lines 0 comments Download
M environs/open.go View 2 chunks +1 line, -5 lines 0 comments Download

Messages

Total messages: 5
niemeyer
Please take a look.
13 years, 7 months ago (2012-07-20 13:56:07 UTC) #1
fwereade
This is *great*, thank you very much. LGTM aside from control-bucket. https://codereview.appspot.com/6416055/diff/4001/environs/ec2/config.go File environs/ec2/config.go (right): ...
13 years, 7 months ago (2012-07-20 14:25:08 UTC) #2
niemeyer
Please take a look.
13 years, 7 months ago (2012-07-20 15:59:52 UTC) #3
fwereade
LGTM with reinstatement of the changed test (and keep the new one, ofc). https://codereview.appspot.com/6416055/diff/6002/environs/ec2/config_test.go File ...
13 years, 7 months ago (2012-07-20 16:13:59 UTC) #4
niemeyer
13 years, 7 months ago (2012-07-20 18:14:45 UTC) #5
*** Submitted:

environs: split out config validation

This enables the validation of environment configurations
independently from the creation of environment instances.

The way in which this was done facilitates:

- the implementation of set-env 
- storage of validated and provider-enriched configs in state
- provider-specific config change rejection

R=fwereade
CC=
https://codereview.appspot.com/6416055

https://codereview.appspot.com/6416055/diff/4001/environs/ec2/config.go
File environs/ec2/config.go (right):

https://codereview.appspot.com/6416055/diff/4001/environs/ec2/config.go#newco...
environs/ec2/config.go:74: return nil, fmt.Errorf("invalid region name %q",
ecfg.region())
On 2012/07/20 14:25:08, fwereade wrote:
> If it's worth checking for a missing endpoint (as we do in Open) I maintain
it's
> worth checking for here rather than there :).

As we talked I don't think it makes sense to check for invalid aws.Regions. We
didn't do this for S3 either, for example.

https://codereview.appspot.com/6416055/diff/4001/environs/ec2/config.go#newco...
environs/ec2/config.go:80: return nil, fmt.Errorf("can't change environment
region from %q to %q", region, ecfg.region())
On 2012/07/20 14:25:08, fwereade wrote:
> I don't think we can safely change control-bucket either.

Good point, that's fixed.

https://codereview.appspot.com/6416055/diff/4001/environs/ec2/ec2.go
File environs/ec2/ec2.go (left):

https://codereview.appspot.com/6416055/diff/4001/environs/ec2/ec2.go#oldcode117
environs/ec2/ec2.go:117: return fmt.Errorf("environment %q references unknown
EC2 region %q", config.name, config.region)
On 2012/07/20 14:25:08, fwereade wrote:
> ...but I guess it's not worth checking for. I always did wonder about that :).

Agreed.

https://codereview.appspot.com/6416055/diff/6002/environs/ec2/config_test.go
File environs/ec2/config_test.go (right):

https://codereview.appspot.com/6416055/diff/6002/environs/ec2/config_test.go#...
environs/ec2/config_test.go:159: err: `can't change control-bucket from "x" to
"new-x"`,
On 2012/07/20 16:13:59, fwereade wrote:
> Why did we lose the 666 test for public-bucket?

Oops. Copy & paste error. That's what I get for not self-reviewing.
Sign in to reply to this message.

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