Allows storagedriver parameter values to be of type interface{}

This enables use of nil, booleans, numeric types, and even complex structures for parameter values, assuming they can be parsed from yaml.
This commit is contained in:
Brian Bland 2014-12-17 19:06:55 -08:00
parent f9b119974d
commit 030b0ff310
5 changed files with 14 additions and 14 deletions

View file

@ -21,12 +21,12 @@ var configStruct = Configuration{
"region": "us-east-1",
"bucket": "my-bucket",
"rootpath": "/registry",
"encrypt": "true",
"secure": "false",
"encrypt": true,
"secure": false,
"accesskey": "SAMPLEACCESSKEY",
"secretkey": "SUPERSECRET",
"host": "",
"port": "",
"host": nil,
"port": 42,
},
},
Reporting: Reporting{
@ -50,7 +50,7 @@ storage:
accesskey: SAMPLEACCESSKEY
secretkey: SUPERSECRET
host: ~
port: ~
port: 42
reporting:
bugsnag:
apikey: BugsnagApiKey
@ -142,7 +142,7 @@ func (suite *ConfigSuite) TestParseWithSameEnvStorage(c *C) {
// Configuration struct
func (suite *ConfigSuite) TestParseWithDifferentEnvStorageParams(c *C) {
suite.expectedConfig.Storage.setParameter("region", "us-west-1")
suite.expectedConfig.Storage.setParameter("secure", "true")
suite.expectedConfig.Storage.setParameter("secure", true)
suite.expectedConfig.Storage.setParameter("newparam", "some Value")
os.Setenv("REGISTRY_STORAGE_S3_REGION", "us-west-1")