mirror of
https://github.com/external-secrets/external-secrets.git
synced 2024-12-14 11:57:59 +00:00
🐛 GCP: prevent goroutine leak on workload identity reconciliation (#1902)
Signed-off-by: Hiroshi Muraoka <h.muraoka714@gmail.com>
This commit is contained in:
parent
922c7e8ece
commit
f4e70ddfed
2 changed files with 3 additions and 2 deletions
|
@ -35,6 +35,7 @@ func NewTokenSource(ctx context.Context, auth esv1beta1.GCPSMAuth, projectID str
|
|||
if err != nil {
|
||||
return nil, fmt.Errorf("unable to initialize workload identity")
|
||||
}
|
||||
defer wi.Close()
|
||||
ts, err = wi.TokenSource(ctx, auth, isClusterKind, kube, namespace)
|
||||
if ts != nil || err != nil {
|
||||
return ts, err
|
||||
|
|
|
@ -78,11 +78,11 @@ type saTokenGenerator interface {
|
|||
}
|
||||
|
||||
func newWorkloadIdentity(ctx context.Context, projectID string) (*workloadIdentity, error) {
|
||||
iamc, err := newIAMClient(ctx)
|
||||
satg, err := newSATokenGenerator()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
satg, err := newSATokenGenerator()
|
||||
iamc, err := newIAMClient(ctx)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue