Skip to content

Commit

Permalink
Added check for access token
Browse files Browse the repository at this point in the history
Signed-off-by: Brad Wadsworth <brad.wadsworth@mavenwave.com>
  • Loading branch information
Brad Wadsworth committed Oct 10, 2022
1 parent 58f1bb5 commit 998cb79
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/clients/gke/gke.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ func WrapRESTConfig(ctx context.Context, rc *rest.Config, credentials []byte, sc
t := oauth2.Token{
AccessToken: string(credentials),
}
if ok := t.Valid(); !ok {
return errors.New("Access token invalid")
}
ts = oauth2.StaticTokenSource(&t)
}
} else {
Expand Down

0 comments on commit 998cb79

Please sign in to comment.