Skip to content

Commit

Permalink
fix(token): do not cancel gcp client context
Browse files Browse the repository at this point in the history
The context passed to new gcloud client should not be canceled.
  • Loading branch information
hodbn authored and mtharp committed Oct 29, 2024
1 parent e00f5e2 commit 53ee1b4
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions token/gcloudtoken/token.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (
"errors"
"fmt"
"io"
"time"

kms "cloud.google.com/go/kms/apiv1"
"google.golang.org/api/option"
Expand Down Expand Up @@ -45,13 +44,11 @@ func open(conf *config.Config, tokenName string, pinProvider passprompt.Password
if err != nil {
return nil, err
}
ctx, cancel := context.WithTimeout(context.Background(), time.Minute)
defer cancel()
var opts []option.ClientOption
if tconf.Pin != nil {
opts = append(opts, option.WithCredentialsFile(*tconf.Pin))
}
cli, err := kms.NewKeyManagementClient(ctx, opts...)
cli, err := kms.NewKeyManagementClient(context.Background(), opts...)
if err != nil {
return nil, err
}
Expand Down

0 comments on commit 53ee1b4

Please sign in to comment.