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

Issue 13355044: environs/config: more restrictive New

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 8 months ago by rog
Modified:
10 years, 7 months ago
Reviewers:
mp+183253, jameinel, fwereade
Visibility:
Public.

Description

environs/config: more restrictive New In most cases, we don't want to suck default config values from environment variables, $HOME, etc. This change makes it possible to be sure that it is not doing so when we don't want it to. Unfortunately, as with most config changes, the repercussions are widespread. I have taken the opportunity to centralise the basic configuration attributes for the tests, so changing the configuration should be easier in the future. Still not done: providers still take defaults from the environment. That will change in another CL. Two drive-by changes: - jujutest.LifeTests.TestConfig becomes a coretesting.Attrs, rather than its own type. I couldn't see that the indirection made any difference to potential map sharing. - firewall modes are no longer typed. There was a conflict between configurations attributes specified as strings and configurations specified with the typed constants, and the most straightforward way out is just to use strings. Almost nothing mentions the type name anyway, which indicates that it's not offering a great deal of protection in practice. https://code.launchpad.net/~rogpeppe/juju-core/381-config-no-defaults/+merge/183253 (do not edit description out of merge proposal)

Patch Set 1 #

Patch Set 2 : environs/config: more restrictive New #

Patch Set 3 : environs/config: more restrictive New #

Total comments: 7

Patch Set 4 : environs/config: more restrictive New #

Patch Set 5 : environs/config: more restrictive New #

Patch Set 6 : environs/config: more restrictive New #

Total comments: 26

Patch Set 7 : environs/config: more restrictive New #

Patch Set 8 : environs/config: more restrictive New #

Total comments: 1

Patch Set 9 : environs/config: more restrictive New #

Patch Set 10 : environs/config: more restrictive New #

Patch Set 11 : environs/config: more restrictive New #

Unified diffs Side-by-side diffs Delta from patch set Stats (+912 lines, -791 lines) Patch
A [revision details] View 1 2 3 4 5 6 7 8 9 10 1 chunk +2 lines, -0 lines 0 comments Download
M cmd/juju/environment_test.go View 1 2 3 4 5 6 5 chunks +12 lines, -8 lines 0 comments Download
M cmd/jujud/bootstrap.go View 1 chunk +1 line, -1 line 0 comments Download
M cmd/jujud/bootstrap_test.go View 1 2 3 4 5 6 2 chunks +8 lines, -9 lines 0 comments Download
M environs/bootstrap/bootstrap_test.go View 1 2 3 4 5 6 3 chunks +14 lines, -29 lines 0 comments Download
M environs/cert.go View 1 chunk +1 line, -1 line 0 comments Download
M environs/cloudinit/cloudinit_test.go View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -8 lines 0 comments Download
M environs/cloudinit_test.go View 1 2 3 4 5 6 5 chunks +20 lines, -21 lines 0 comments Download
M environs/config.go View 2 chunks +3 lines, -3 lines 0 comments Download
M environs/config/config.go View 1 2 3 4 5 6 7 8 14 chunks +259 lines, -140 lines 0 comments Download
M environs/config/config_test.go View 1 2 3 25 chunks +287 lines, -145 lines 0 comments Download
M environs/config_test.go View 1 2 3 4 5 6 2 chunks +16 lines, -19 lines 0 comments Download
M environs/imagemetadata/urls_test.go View 1 2 3 4 5 6 7 8 9 2 chunks +5 lines, -9 lines 0 comments Download
M environs/jujutest/livetests.go View 1 2 3 4 5 6 4 chunks +10 lines, -12 lines 0 comments Download
M environs/jujutest/tests.go View 1 2 3 4 2 chunks +5 lines, -24 lines 0 comments Download
M environs/open.go View 1 chunk +1 line, -1 line 0 comments Download
M environs/open_test.go View 1 2 3 4 5 6 2 chunks +4 lines, -15 lines 0 comments Download
M environs/tools/storage_test.go View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -8 lines 0 comments Download
M environs/tools/tools_test.go View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -12 lines 0 comments Download
M environs/tools/urls_test.go View 1 2 3 4 5 6 7 8 9 2 chunks +5 lines, -9 lines 0 comments Download
M juju/apiconn_test.go View 1 2 3 4 5 6 1 chunk +1 line, -10 lines 0 comments Download
M juju/conn_test.go View 1 2 3 4 5 6 7 8 9 7 chunks +14 lines, -48 lines 0 comments Download
M juju/testing/conn.go View 1 2 3 4 5 6 7 8 9 4 chunks +19 lines, -13 lines 0 comments Download
M provider/azure/config_test.go View 1 2 3 4 5 6 12 chunks +23 lines, -33 lines 0 comments Download
M provider/azure/environ_test.go View 1 2 3 4 5 6 7 8 9 7 chunks +7 lines, -7 lines 0 comments Download
M provider/azure/environprovider_test.go View 2 chunks +2 lines, -2 lines 0 comments Download
M provider/dummy/config_test.go View 1 2 3 4 5 6 4 chunks +9 lines, -20 lines 0 comments Download
M provider/dummy/environs.go View 1 2 3 4 5 6 7 8 9 3 chunks +26 lines, -5 lines 0 comments Download
M provider/dummy/environs_test.go View 1 2 3 4 5 6 1 chunk +3 lines, -13 lines 0 comments Download
M provider/ec2/config_test.go View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -1 line 0 comments Download
M provider/ec2/live_test.go View 1 2 3 4 5 6 4 chunks +10 lines, -9 lines 0 comments Download
M provider/ec2/local_test.go View 1 2 3 4 5 6 7 8 9 3 chunks +4 lines, -8 lines 0 comments Download
M provider/local/config_test.go View 1 2 3 4 5 6 7 8 9 3 chunks +5 lines, -9 lines 0 comments Download
M provider/local/environ_test.go View 2 chunks +2 lines, -2 lines 0 comments Download
M provider/maas/config_test.go View 1 2 3 4 5 6 2 chunks +5 lines, -16 lines 0 comments Download
M provider/maas/environ_test.go View 1 2 3 4 5 6 7 8 9 1 chunk +8 lines, -15 lines 0 comments Download
M provider/maas/environprovider_test.go View 1 2 3 4 5 6 3 chunks +14 lines, -17 lines 0 comments Download
M provider/openstack/config_test.go View 1 2 3 4 5 6 2 chunks +7 lines, -8 lines 0 comments Download
M provider/openstack/live_test.go View 1 2 3 4 5 6 3 chunks +13 lines, -17 lines 0 comments Download
M provider/openstack/local_test.go View 1 2 3 4 5 6 7 8 9 2 chunks +3 lines, -3 lines 0 comments Download
M provider/state_test.go View 1 2 3 4 5 6 1 chunk +2 lines, -6 lines 0 comments Download
M state/initialize_test.go View 1 chunk +1 line, -1 line 0 comments Download
M state/state.go View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M state/state_test.go View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M state/watcher.go View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
A testing/attrs.go View 1 chunk +27 lines, -0 lines 0 comments Download
M testing/environ.go View 1 2 3 4 5 6 7 8 9 1 chunk +24 lines, -10 lines 0 comments Download
M worker/environ_test.go View 2 chunks +2 lines, -2 lines 0 comments Download
M worker/firewaller/firewaller_test.go View 6 chunks +14 lines, -29 lines 0 comments Download
M worker/provisioner/provisioner_test.go View 1 chunk +1 line, -1 line 0 comments Download
M worker/uniter/uniter_test.go View 1 2 3 4 5 6 2 chunks +6 lines, -9 lines 0 comments Download

Messages

Total messages: 15
rog
Please take a look.
10 years, 8 months ago (2013-08-30 19:30:52 UTC) #1
rog
Please take a look.
10 years, 8 months ago (2013-08-30 20:46:34 UTC) #2
jameinel
I don't quite understand the motivation for this. Is this just that we don't want ...
10 years, 8 months ago (2013-09-01 11:43:16 UTC) #3
fwereade
On 2013/09/01 11:43:16, jameinel wrote: > I don't quite understand the motivation for this. Is ...
10 years, 8 months ago (2013-09-02 09:29:39 UTC) #4
jameinel
I have a couple of questions about the core bits, but the rest just looks ...
10 years, 8 months ago (2013-09-03 08:10:23 UTC) #5
rog
I realised that the live tests didn't pass and that the changes I made were ...
10 years, 7 months ago (2013-09-11 17:59:12 UTC) #6
rog
Please take a look.
10 years, 7 months ago (2013-09-11 18:00:50 UTC) #7
jameinel
https://codereview.appspot.com/13355044/diff/7001/environs/config/config.go File environs/config/config.go (right): https://codereview.appspot.com/13355044/diff/7001/environs/config/config.go#newcode162 environs/config/config.go:162: return fmt.Errorf("attribute %q is not allowed in configuration", attr) ...
10 years, 7 months ago (2013-09-12 06:29:52 UTC) #8
rog
On 12 September 2013 07:29, <john.meinel@canonical.com> wrote: > > https://codereview.appspot.com/13355044/diff/7001/environs/config/config.go > File environs/config/config.go (right): > ...
10 years, 7 months ago (2013-09-12 06:47:44 UTC) #9
fwereade
This is great, but I have enough quibbles that I can't quite issue the magic ...
10 years, 7 months ago (2013-09-12 09:20:16 UTC) #10
rog
Please take a look. https://codereview.appspot.com/13355044/diff/20053/environs/config/config.go File environs/config/config.go (right): https://codereview.appspot.com/13355044/diff/20053/environs/config/config.go#newcode56 environs/config/config.go:56: NoDefaults Defaulting = false On ...
10 years, 7 months ago (2013-09-12 13:21:29 UTC) #11
fwereade
LGTM if you're ok with the int thing. https://codereview.appspot.com/13355044/diff/20053/environs/config/config.go File environs/config/config.go (right): https://codereview.appspot.com/13355044/diff/20053/environs/config/config.go#newcode297 environs/config/config.go:297: // ...
10 years, 7 months ago (2013-09-12 13:59:49 UTC) #12
rog
Please take a look. https://codereview.appspot.com/13355044/diff/20053/environs/config/config.go File environs/config/config.go (right): https://codereview.appspot.com/13355044/diff/20053/environs/config/config.go#newcode297 environs/config/config.go:297: // it is not found ...
10 years, 7 months ago (2013-09-12 14:15:44 UTC) #13
rog
Please take a look.
10 years, 7 months ago (2013-09-12 14:26:03 UTC) #14
rog
10 years, 7 months ago (2013-09-12 14:57:14 UTC) #15
Please take a look.
Sign in to reply to this message.

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