diff --git a/pkg/acsengine/engine.go b/pkg/acsengine/engine.go index c1cde07d8d..8f45681122 100644 --- a/pkg/acsengine/engine.go +++ b/pkg/acsengine/engine.go @@ -368,13 +368,16 @@ func FormatAzureProdFQDNs(fqdnPrefix string) []string { // FormatAzureProdFQDN constructs an Azure prod fqdn func FormatAzureProdFQDN(fqdnPrefix string, location string) string { - FQDNFormat := AzureCloudSpec.EndpointConfig.ResourceManagerVMDNSSuffix - if location == "chinaeast" || location == "chinanorth" { + var FQDNFormat string + switch GetCloudTargetEnv(location) { + case azureChinaCloud: FQDNFormat = AzureChinaCloudSpec.EndpointConfig.ResourceManagerVMDNSSuffix - } else if location == "germanynortheast" || location == "germanycentral" { + case azureGermanCloud: FQDNFormat = AzureGermanCloudSpec.EndpointConfig.ResourceManagerVMDNSSuffix - } else if location == "usgovvirginia" || location == "usgoviowa" || location == "usgovarizona" || location == "usgovtexas" { + case azureUSGovernmentCloud: FQDNFormat = AzureUSGovernmentCloud.EndpointConfig.ResourceManagerVMDNSSuffix + default: + FQDNFormat = AzureCloudSpec.EndpointConfig.ResourceManagerVMDNSSuffix } return fmt.Sprintf("%s.%s."+FQDNFormat, fqdnPrefix, location) }