Skip to content

Commit

Permalink
error wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
cvvz committed Feb 20, 2023
1 parent 73490fc commit f2fcc1f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/provider/config/azure_auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,11 +169,11 @@ func GetServicePrincipalToken(config *AzureAuthConfig, env *azure.Environment, r
klog.V(2).Infoln("azure: using workload identity extension to retrieve access token")
jwt, err := os.ReadFile(config.AADFederatedTokenFile)
if err != nil {
return nil, fmt.Errorf("failed to read a file with a federated token: %v", err)
return nil, fmt.Errorf("failed to read a file with a federated token: %w", err)
}
token, err := adal.NewServicePrincipalTokenFromFederatedToken(*oauthConfig, config.AADClientID, string(jwt), env.ResourceManagerEndpoint)
if err != nil {
return nil, fmt.Errorf("failed to create a workload identity token: %v", err)
return nil, fmt.Errorf("failed to create a workload identity token: %w", err)
}
return token, nil
}
Expand Down

0 comments on commit f2fcc1f

Please sign in to comment.