mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-08 19:47:56 +00:00
fixed golint issues.
This commit is contained in:
parent
159e5034cf
commit
14b648d203
@ -32,7 +32,7 @@ import (
|
|||||||
var (
|
var (
|
||||||
// ErrorNoAuth indicates that no credentials are provided.
|
// ErrorNoAuth indicates that no credentials are provided.
|
||||||
ErrorNoAuth = fmt.Errorf("no credentials provided for Azure cloud provider")
|
ErrorNoAuth = fmt.Errorf("no credentials provided for Azure cloud provider")
|
||||||
// Tenenatid value for Azure Stack ADFS case.
|
// ADFSIdentitySystem indicates value of tenantId for ADFS on Azure Stack.
|
||||||
ADFSIdentitySystem = "ADFS"
|
ADFSIdentitySystem = "ADFS"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -64,11 +64,11 @@ type AzureAuthConfig struct {
|
|||||||
|
|
||||||
// GetServicePrincipalToken creates a new service principal token based on the configuration
|
// GetServicePrincipalToken creates a new service principal token based on the configuration
|
||||||
func GetServicePrincipalToken(config *AzureAuthConfig, env *azure.Environment) (*adal.ServicePrincipalToken, error) {
|
func GetServicePrincipalToken(config *AzureAuthConfig, env *azure.Environment) (*adal.ServicePrincipalToken, error) {
|
||||||
var tenantId string
|
var tenantID string
|
||||||
if strings.EqualFold(config.IdentitySystem, ADFSIdentitySystem) {
|
if strings.EqualFold(config.IdentitySystem, ADFSIdentitySystem) {
|
||||||
tenantId = "adfs"
|
tenantID = "adfs"
|
||||||
} else {
|
} else {
|
||||||
tenantId = config.TenantID
|
tenantID = config.TenantID
|
||||||
}
|
}
|
||||||
|
|
||||||
if config.UseManagedIdentityExtension {
|
if config.UseManagedIdentityExtension {
|
||||||
@ -89,7 +89,7 @@ func GetServicePrincipalToken(config *AzureAuthConfig, env *azure.Environment) (
|
|||||||
env.ServiceManagementEndpoint)
|
env.ServiceManagementEndpoint)
|
||||||
}
|
}
|
||||||
|
|
||||||
oauthConfig, err := adal.NewOAuthConfig(env.ActiveDirectoryEndpoint, tenantId)
|
oauthConfig, err := adal.NewOAuthConfig(env.ActiveDirectoryEndpoint, tenantID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("creating the OAuth config: %v", err)
|
return nil, fmt.Errorf("creating the OAuth config: %v", err)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user