@@ -132,7 +132,9 @@ func GetServicePrincipalToken(config *AzureAuthConfig, env *azure.Environment) (
132
132
return nil , ErrorNoAuth
133
133
}
134
134
135
- // ParseAzureEnvironment returns azure environment by name
135
+ // ParseAzureEnvironment returns the azure environment.
136
+ // If 'cloudFQDN' is set, environment is computed by quering the cloud's resource manager endpoint.
137
+ // Otherwise, a pre-defined Environment is looked up by name.
136
138
func ParseAzureEnvironment (cloudName , cloudFQDN , identitySystem string ) (* azure.Environment , error ) {
137
139
var env azure.Environment
138
140
var err error
@@ -169,14 +171,14 @@ func decodePkcs12(pkcs []byte, password string) (*x509.Certificate, *rsa.Private
169
171
return certificate , rsaPrivateKey , nil
170
172
}
171
173
174
+ // azureStackOverrides ensures that the Environment matches what AKSe currently generates for Azure Stack
172
175
func azureStackOverrides (env * azure.Environment , cloudFQDN , identitySystem string ) {
173
- // if AzureStack, make sure the generated environment matches what AKSe currently generates
174
176
env .ManagementPortalURL = fmt .Sprintf ("https://portal.%s/" , cloudFQDN )
175
177
// TODO: figure out why AKSe does this
176
178
// why is autorest not setting ServiceManagementEndpoint?
177
179
env .ServiceManagementEndpoint = env .TokenAudience
178
180
// TODO: figure out why AKSe does this
179
- // ResourceManagerVMDNSSuffix is not referenced in k/k
181
+ // May not be required, ResourceManagerVMDNSSuffix is not used by k/k
180
182
split := strings .Split (cloudFQDN , "." )
181
183
domain := strings .Join (split [1 :], "." )
182
184
env .ResourceManagerVMDNSSuffix = fmt .Sprintf ("cloudapp.%s" , domain )
0 commit comments