Skip to content

Commit

Permalink
use background context
Browse files Browse the repository at this point in the history
  • Loading branch information
jo-bisonai committed May 2, 2024
1 parent c4bedf3 commit 1fe3030
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion api/secrets/secrets.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ type Secrets struct {
}

func (s *SecretEnv) GetSecretFromVaultWithKubernetesAuth() (*Secrets, error) {
ctx := context.Background()
config := vault.DefaultConfig()
client, err := vault.NewClient(config)
if err != nil {
Expand All @@ -35,7 +36,7 @@ func (s *SecretEnv) GetSecretFromVaultWithKubernetesAuth() (*Secrets, error) {
return nil, fmt.Errorf("unable to initialize Kubernetes auth method: %w", err)
}

authInfo, err := client.Auth().Login(context.TODO(), k8sAuth)
authInfo, err := client.Auth().Login(ctx, k8sAuth)
if err != nil {
return nil, fmt.Errorf("unable to log in with Kubernetes auth: %w", err)
}
Expand Down

0 comments on commit 1fe3030

Please sign in to comment.