storage/driver/azure: Allow non-default realms
This enables Azure storage driver to be used with non-default cloud endpoints like Azure China or Azure Government that does not use `.blob.core.windows.net` FQDN suffix. Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>
This commit is contained in:
parent
af4f5aa7d2
commit
594f733e03
2 changed files with 15 additions and 5 deletions
|
@ -15,6 +15,7 @@ const (
|
|||
envAccountName = "AZURE_STORAGE_ACCOUNT_NAME"
|
||||
envAccountKey = "AZURE_STORAGE_ACCOUNT_KEY"
|
||||
envContainer = "AZURE_STORAGE_CONTAINER"
|
||||
envRealm = "AZURE_STORAGE_REALM"
|
||||
)
|
||||
|
||||
// Hook up gocheck into the "go test" runner.
|
||||
|
@ -25,6 +26,7 @@ func init() {
|
|||
accountName string
|
||||
accountKey string
|
||||
container string
|
||||
realm string
|
||||
)
|
||||
|
||||
config := []struct {
|
||||
|
@ -34,6 +36,7 @@ func init() {
|
|||
{envAccountName, &accountName},
|
||||
{envAccountKey, &accountKey},
|
||||
{envContainer, &container},
|
||||
{envRealm, &realm},
|
||||
}
|
||||
|
||||
missing := []string{}
|
||||
|
@ -45,7 +48,7 @@ func init() {
|
|||
}
|
||||
|
||||
azureDriverConstructor := func() (storagedriver.StorageDriver, error) {
|
||||
return New(accountName, accountKey, container)
|
||||
return New(accountName, accountKey, container, realm)
|
||||
}
|
||||
|
||||
// Skip Azure storage driver tests if environment variable parameters are not provided
|
||||
|
@ -61,5 +64,6 @@ func init() {
|
|||
// paramAccountName: accountName,
|
||||
// paramAccountKey: accountKey,
|
||||
// paramContainer: container,
|
||||
// paramRealm: realm,
|
||||
// }, skipCheck)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue