Skip to content

Commit

Permalink
grab access token when assuming service account (#358)
Browse files Browse the repository at this point in the history
This will be needed when injecting config into console and other apps where a durable token will be needed
  • Loading branch information
michaeljguarino authored Mar 1, 2023
1 parent 6296cf3 commit 331ce26
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion cmd/plural/plural.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,14 @@ func (p *Plural) InitPluralClient() {
}
conf.Email = email
conf.Token = jwt
config.SetConfig(&conf)
p.Client = api.FromConfig(&conf)
accessToken, err := p.Client.GrabAccessToken()
if err != nil {
utils.Error("failed to create access token, bailing")
os.Exit(1)
}
conf.Token = accessToken
config.SetConfig(&conf)
return
}
}
Expand Down

0 comments on commit 331ce26

Please sign in to comment.