Update Azure dependencies
* azure-sdk-for-go to 3.1.0-beta * go-autorest to 7.0.7 * import dgrijalva/jwt-go at 3.0.0
This commit is contained in:
parent
323dc70ed6
commit
97b1915d51
|
@ -299,21 +299,37 @@ func setUserNamePassword(c *Config) {
|
|||
}
|
||||
|
||||
func setCloudEnvironment(c *Config) error {
|
||||
lookup := map[string]string{
|
||||
"CHINA": "AzureChinaCloud",
|
||||
"CHINACLOUD": "AzureChinaCloud",
|
||||
"AZURECHINACLOUD": "AzureChinaCloud",
|
||||
|
||||
"GERMAN": "AzureGermanCloud",
|
||||
"GERMANCLOUD": "AzureGermanCloud",
|
||||
"AZUREGERMANCLOUD": "AzureGermanCloud",
|
||||
|
||||
"GERMANY": "AzureGermanCloud",
|
||||
"GERMANYCLOUD": "AzureGermanCloud",
|
||||
"AZUREGERMANYCLOUD": "AzureGermanCloud",
|
||||
|
||||
"PUBLIC": "AzurePublicCloud",
|
||||
"PUBLICCLOUD": "AzurePublicCloud",
|
||||
"AZUREPUBLICCLOUD": "AzurePublicCloud",
|
||||
|
||||
"USGOVERNMENT": "AzureUSGovernmentCloud",
|
||||
"USGOVERNMENTCLOUD": "AzureUSGovernmentCloud",
|
||||
"AZUREUSGOVERNMENTCLOUD": "AzureUSGovernmentCloud",
|
||||
}
|
||||
|
||||
name := strings.ToUpper(c.CloudEnvironmentName)
|
||||
switch name {
|
||||
case "CHINA", "CHINACLOUD", "AZURECHINACLOUD":
|
||||
c.cloudEnvironment = &azure.ChinaCloud
|
||||
case "GERMAN", "GERMANCLOUD", "AZUREGERMANCLOUD":
|
||||
c.cloudEnvironment = &azure.GermanCloud
|
||||
case "PUBLIC", "PUBLICCLOUD", "AZUREPUBLICCLOUD":
|
||||
c.cloudEnvironment = &azure.PublicCloud
|
||||
case "USGOVERNMENT", "USGOVERNMENTCLOUD", "AZUREUSGOVERNMENTCLOUD":
|
||||
c.cloudEnvironment = &azure.USGovernmentCloud
|
||||
default:
|
||||
envName, ok := lookup[name]
|
||||
if !ok {
|
||||
return fmt.Errorf("There is no cloud envionment matching the name '%s'!", c.CloudEnvironmentName)
|
||||
}
|
||||
|
||||
return nil
|
||||
env, err := azure.EnvironmentFromName(envName)
|
||||
c.cloudEnvironment = &env
|
||||
return err
|
||||
}
|
||||
|
||||
func provideDefaultValues(c *Config) {
|
||||
|
|
|
@ -24,4 +24,3 @@ func TestVaultClientKeyVaultEndpointPreserveScheme(t *testing.T) {
|
|||
t.Errorf("expected \"http://my.vault.azure.net/\", got %q", vaultUrl)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -57,7 +57,7 @@ builder.
|
|||
|
||||
### Optional:
|
||||
|
||||
- `cloud_environment_name` (string) One of `Public`, `China`, `German`, or
|
||||
- `cloud_environment_name` (string) One of `Public`, `China`, `Germany`, or
|
||||
`USGovernment`. Defaults to `Public`. Long forms such as
|
||||
`USGovernmentCloud` and `AzureUSGovernmentCloud` are also supported.
|
||||
|
||||
|
|
Loading…
Reference in New Issue