Skip to content

Commit 11b0e9a

Browse files
committed
better comments
1 parent 55828d0 commit 11b0e9a

File tree

1 file changed

+5
-3
lines changed
  • staging/src/k8s.io/legacy-cloud-providers/azure/auth

1 file changed

+5
-3
lines changed

staging/src/k8s.io/legacy-cloud-providers/azure/auth/azure_auth.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,9 @@ func GetServicePrincipalToken(config *AzureAuthConfig, env *azure.Environment) (
132132
return nil, ErrorNoAuth
133133
}
134134

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.
136138
func ParseAzureEnvironment(cloudName, cloudFQDN, identitySystem string) (*azure.Environment, error) {
137139
var env azure.Environment
138140
var err error
@@ -169,14 +171,14 @@ func decodePkcs12(pkcs []byte, password string) (*x509.Certificate, *rsa.Private
169171
return certificate, rsaPrivateKey, nil
170172
}
171173

174+
// azureStackOverrides ensures that the Environment matches what AKSe currently generates for Azure Stack
172175
func azureStackOverrides(env *azure.Environment, cloudFQDN, identitySystem string) {
173-
// if AzureStack, make sure the generated environment matches what AKSe currently generates
174176
env.ManagementPortalURL = fmt.Sprintf("https://portal.%s/", cloudFQDN)
175177
// TODO: figure out why AKSe does this
176178
// why is autorest not setting ServiceManagementEndpoint?
177179
env.ServiceManagementEndpoint = env.TokenAudience
178180
// 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
180182
split := strings.Split(cloudFQDN, ".")
181183
domain := strings.Join(split[1:], ".")
182184
env.ResourceManagerVMDNSSuffix = fmt.Sprintf("cloudapp.%s", domain)

0 commit comments

Comments
 (0)