1
0
Fork 0
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:
Hiroshi Muraoka 2023-01-12 21:27:01 +09:00 committed by GitHub
parent 922c7e8ece
commit f4e70ddfed
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View file

@ -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

View file

@ -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
}