@@ -64,10 +64,10 @@ type AzureAuthConfig struct {
64
64
SubscriptionID string `json:"subscriptionId,omitempty" yaml:"subscriptionId,omitempty"`
65
65
// IdentitySystem indicates the identity provider. Relevant only to hybrid clouds (Azure Stack).
66
66
// Allowed values are 'azure_ad' (default), 'adfs'.
67
- IdentitySystem string `json:"identitySystem" yaml:"identitySystem"`
67
+ IdentitySystem string `json:"identitySystem,omitempty " yaml:"identitySystem,omitempty "`
68
68
// CloudFQDN represents the hybrid cloud's fully qualified domain name: {location}.{domain}
69
69
// If set, cloud provider will generate its autorest.Environment instead of using one of the pre-defined ones.
70
- CloudFQDN string `json:"cloudFQDN" yaml:"cloudFQDN"`
70
+ CloudFQDN string `json:"cloudFQDN,omitempty " yaml:"cloudFQDN,omitempty "`
71
71
}
72
72
73
73
// GetServicePrincipalToken creates a new service principal token based on the configuration
@@ -142,11 +142,13 @@ func ParseAzureEnvironment(cloudName, cloudFQDN, identitySystem string) (*azure.
142
142
klog .V (4 ).Infof ("Loading environment from resource manager endpoint: %s" , resourceManagerEndpoint )
143
143
env , err = azure .EnvironmentFromURL (resourceManagerEndpoint , nameOverride )
144
144
if err == nil && strings .EqualFold (cloudName , "AzureStackCloud" ) {
145
- azureStackOverrides (env , cloudFQDN , identitySystem )
145
+ azureStackOverrides (& env , cloudFQDN , identitySystem )
146
146
}
147
147
} else if cloudName == "" {
148
+ klog .V (4 ).Info ("Using public cloud environment" )
148
149
env = azure .PublicCloud
149
150
} else {
151
+ klog .V (4 ).Infof ("Using %s environment" , cloudName )
150
152
env , err = azure .EnvironmentFromName (cloudName )
151
153
}
152
154
return & env , err
@@ -167,7 +169,7 @@ func decodePkcs12(pkcs []byte, password string) (*x509.Certificate, *rsa.Private
167
169
return certificate , rsaPrivateKey , nil
168
170
}
169
171
170
- func azureStackOverrides (env azure.Environment , cloudFQDN , identitySystem string ) azure. Environment {
172
+ func azureStackOverrides (env * azure.Environment , cloudFQDN , identitySystem string ) {
171
173
// if AzureStack, make sure the generated environment matches what AKSe currently generates
172
174
env .ManagementPortalURL = fmt .Sprintf ("https://portal.%s/" , cloudFQDN )
173
175
// TODO: figure out why AKSe does this
@@ -183,5 +185,4 @@ func azureStackOverrides(env azure.Environment, cloudFQDN, identitySystem string
183
185
env .ActiveDirectoryEndpoint = strings .TrimSuffix (env .ActiveDirectoryEndpoint , "/" )
184
186
env .ActiveDirectoryEndpoint = strings .TrimSuffix (env .ActiveDirectoryEndpoint , "adfs" )
185
187
}
186
- return env
187
188
}
0 commit comments