From 11b0e9af25139f74c17e4a85b3caccb8451fd040 Mon Sep 17 00:00:00 2001 From: jadarsie Date: Thu, 21 Nov 2019 10:36:04 -0800 Subject: [PATCH] better comments --- .../legacy-cloud-providers/azure/auth/azure_auth.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/staging/src/k8s.io/legacy-cloud-providers/azure/auth/azure_auth.go b/staging/src/k8s.io/legacy-cloud-providers/azure/auth/azure_auth.go index 22dd24b78d2..85301801bde 100644 --- a/staging/src/k8s.io/legacy-cloud-providers/azure/auth/azure_auth.go +++ b/staging/src/k8s.io/legacy-cloud-providers/azure/auth/azure_auth.go @@ -132,7 +132,9 @@ func GetServicePrincipalToken(config *AzureAuthConfig, env *azure.Environment) ( return nil, ErrorNoAuth } -// ParseAzureEnvironment returns azure environment by name +// ParseAzureEnvironment returns the azure environment. +// If 'cloudFQDN' is set, environment is computed by quering the cloud's resource manager endpoint. +// Otherwise, a pre-defined Environment is looked up by name. func ParseAzureEnvironment(cloudName, cloudFQDN, identitySystem string) (*azure.Environment, error) { var env azure.Environment var err error @@ -169,14 +171,14 @@ func decodePkcs12(pkcs []byte, password string) (*x509.Certificate, *rsa.Private return certificate, rsaPrivateKey, nil } +// azureStackOverrides ensures that the Environment matches what AKSe currently generates for Azure Stack func azureStackOverrides(env *azure.Environment, cloudFQDN, identitySystem string) { - // if AzureStack, make sure the generated environment matches what AKSe currently generates env.ManagementPortalURL = fmt.Sprintf("https://portal.%s/", cloudFQDN) // TODO: figure out why AKSe does this // why is autorest not setting ServiceManagementEndpoint? env.ServiceManagementEndpoint = env.TokenAudience // TODO: figure out why AKSe does this - // ResourceManagerVMDNSSuffix is not referenced in k/k + // May not be required, ResourceManagerVMDNSSuffix is not used by k/k split := strings.Split(cloudFQDN, ".") domain := strings.Join(split[1:], ".") env.ResourceManagerVMDNSSuffix = fmt.Sprintf("cloudapp.%s", domain)