Skip to content

Commit

Permalink
fix: perform initial gcloud check and reuse token (#657)
Browse files Browse the repository at this point in the history
Co-authored-by: Eno Compton <enocom@google.com>
  • Loading branch information
kurtisvg and enocom committed Mar 5, 2021
1 parent 3328c0e commit f3bf3f9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion proxy/util/gcloudutil.go
Expand Up @@ -114,5 +114,10 @@ func (src *gcloudTokenSource) Token() (*oauth2.Token, error) {
}

func GcloudTokenSource(ctx context.Context) (oauth2.TokenSource, error) {
return &gcloudTokenSource{}, nil
src := &gcloudTokenSource{}
tok, err := src.Token()
if err != nil {
return nil, err
}
return oauth2.ReuseTokenSource(tok, src), nil
}

0 comments on commit f3bf3f9

Please sign in to comment.