Skip to content

Commit

Permalink
Reuse GetCloudTargetEnv in FormatAzureProdFQDN (Azure#2376)
Browse files Browse the repository at this point in the history
* reuse GetCloudTargetEnv in FormatAzureProdFQDN

* Fix FQDNFormat lint error
  • Loading branch information
gsacavdm authored and Terje Torkelsen committed Mar 15, 2018
1 parent c5babfd commit 0635fe5
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions pkg/acsengine/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit 0635fe5

Please sign in to comment.