Skip to content

Commit

Permalink
Fix SOPS azkv envCred
Browse files Browse the repository at this point in the history
At the moment, the envCred logic can't actually set the Azure credentials.

This commit fixes the logic so that the environment variables can
actually be used to set the Azure credentials.

There are other issues that come up from this block of code, but those
can be dealt with separately.
  • Loading branch information
apeschel committed Apr 21, 2023
1 parent 6ecf425 commit 64cde15
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions internal/sops/azkv/keysource.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,14 +222,13 @@ func getDefaultAzureCredential() (azcore.TokenCredential, error) {
)

var errorMessages []string
var creds []azcore.TokenCredential
options := &azidentity.DefaultAzureCredentialOptions{}

envCred, err := azidentity.NewEnvironmentCredential(&azidentity.EnvironmentCredentialOptions{
ClientOptions: options.ClientOptions, DisableInstanceDiscovery: options.DisableInstanceDiscovery},
)
if err == nil {
creds = append(creds, envCred)
return envCred, nil
} else {
errorMessages = append(errorMessages, "EnvironmentCredential: "+err.Error())
}
Expand Down

0 comments on commit 64cde15

Please sign in to comment.