mirror of
https://github.com/zalando/postgres-operator.git
synced 2026-10-01 15:47:38 +02:00
Avoid calling Team API with an expired token.
Previously, the controller fetched the Oauth token once at start, so eventually the token would expire and the operator could not create new users. This commit makes the operator fetch the token before each call to the Teams API.
This commit is contained in:
committed by
Murat Kabilov
parent
b6e6308bdc
commit
48ba6adf8a
@@ -68,12 +68,7 @@ func (c *Controller) initController() {
|
||||
c.logger.Fatalf("Can't register ThirdPartyResource: %s", err)
|
||||
}
|
||||
|
||||
token, err := c.getOAuthToken()
|
||||
if err != nil {
|
||||
c.logger.Errorf("Can't get OAuth token: %s", err)
|
||||
} else {
|
||||
c.config.TeamsAPIClient.OAuthToken = token
|
||||
}
|
||||
c.config.TeamsAPIClient.RefreshTokenAction = c.getOAuthToken
|
||||
|
||||
// Postgresqls
|
||||
clusterLw := &cache.ListWatch{
|
||||
|
||||
Reference in New Issue
Block a user