Merge lp:~axwalk/juju-core/lp1235100-null-provider-storage into lp:~go-bot/juju-core/trunk
Status: | Merged | ||||||||
---|---|---|---|---|---|---|---|---|---|
Approved by: | Andrew Wilkins | ||||||||
Approved revision: | no longer in the source branch. | ||||||||
Merged at revision: | 1951 | ||||||||
Proposed branch: | lp:~axwalk/juju-core/lp1235100-null-provider-storage | ||||||||
Merge into: | lp:~go-bot/juju-core/trunk | ||||||||
Diff against target: |
52 lines (+8/-5) 3 files modified
provider/null/config.go (+0/-1) provider/null/config_test.go (+5/-0) provider/null/environ.go (+3/-4) |
||||||||
To merge this branch: | bzr merge lp:~axwalk/juju-core/lp1235100-null-provider-storage | ||||||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Juju Engineering | Pending | ||
Review via email:
|
Commit message
provider/null: fix storage issues
- Don't require CAKey to create a storage client
- Do not specify a default for storage-auth-key,
and fail validation if it's not set.
A machine agent will not have an authkey initially,
as it's a secret. It is transmitted on the first
API connection. We need to fail config validation
until that point.
Fixes #1235100
Fixes #1235084
Description of the change
provider/null: fix storage issues
- Don't require CAKey to create a storage client
- Do not specify a default for storage-auth-key,
and fail validation if it's not set.
A machine agent will not have an authkey initially,
as it's a secret. It is transmitted on the first
API connection. We need to fail config validation
until that point.
Fixes #1235100
Fixes #1235084
Reviewers: mp+189221_ code.launchpad. net,
Message:
Please take a look.
Description:
provider/null: fix storage issues
- Don't require CAKey to create a storage client
- Fall back to HTTP if we don't have an authkey
- Allow authkey to be omitted from config
A machine agent will not have an authkey initially,
as it's a secret. It is transmitted on the first
API connection. The machine agent doesn't need to
modify storage at this time.
Fixes #1235100
Fixes #1235084
https:/ /code.launchpad .net/~axwalk/ juju-core/ lp1235100- null-provider- storage/ +merge/ 189221
(do not edit description out of merge proposal)
Please review this at https:/ /codereview. appspot. com/14387043/
Affected files (+14, -10 lines): null/config. go null/config_ test.go null/environ. go
A [revision details]
M provider/
M provider/
M provider/
Index: [revision details] 20131003170932- 4tkr0tu40wb0nfg l
=== added file '[revision details]'
--- [revision details] 2012-01-01 00:00:00 +0000
+++ [revision details] 2012-01-01 00:00:00 +0000
@@ -0,0 +1,2 @@
+Old revision: tarmac-
+New revision: <email address hidden>
Index: provider/ null/config. go null/config. go' null/config. go 2013-09-27 02:31:30 +0000 null/config. go 2013-10-04 07:32:01 +0000
=== modified file 'provider/
--- provider/
+++ provider/
@@ -60,7 +60,8 @@
}
func (c *environConfig) storageAuthKey() string { "storage- auth-key" ].(string) "storage- auth-key" ].(string)
- return c.attrs[
+ authkey, _ := c.attrs[
+ return authkey
}
// storageAddr returns an address for connecting to the
Index: provider/ null/config_ test.go null/config_ test.go' null/config_ test.go 2013-09-27 02:31:30 +0000 null/config_ test.go 2013-10-04 07:32:01 +0000
=== modified file 'provider/
--- provider/
+++ provider/
@@ -28,10 +28,9 @@
func minimalConfigVa lues() map[string] interface{ } { interface{ }{
return map[string]
- "name": "test",
- "type": provider.Null,
- "bootstrap-host": "hostname",
- "storage-auth-key": "whatever",
+ "name": "test",
+ "type": provider.Null,
+ "bootstrap-host": "hostname",
// While the ca-cert bits aren't entirely minimal, they avoid the need
// to set up a fake home.
"ca-cert": coretesting.CACert,
Index: provider/ null/environ. go null/environ. go' null/environ. go 2013-10-02 10:38:04 +0000 null/environ. go 2013-10-04 07:32:01 +0000 ClientTLS( e.envConfig( ).storageAddr( ), Errorf( "missing CA cert or private key") Infof(" missing CA cert or auth-key")
=== modified file 'provider/
--- provider/
+++ provider/
@@ -165,9 +165,8 @@
if e.bootstrapStorage != nil {
return e.bootstrapStorage
}
- caCertPEM, caKeyPEM := e.StorageCACert(), e.StorageCAKey()
- if caCertPEM != nil && caKeyPEM != nil {
- authkey := e.StorageAuthKey()
+ caCertPEM, authkey := e.StorageCACert(), e.StorageAuthKey()
+ if caCertPEM != nil && authkey != "" {
storage, err := httpstorage.
caCertPEM, authkey)
if err != nil {
// Should be impossible, since ca-cert will always be validated.
@@ -176,9 +175,12 @@
return storage
}
} else {
- logger.
+ logger.
}
- return nil
+ // It's not necessarily an error not to have the au...