mirror of
https://github.com/zalando/postgres-operator.git
synced 2026-10-18 08:33:49 +02:00
Bugfix/close db connections (#78)
Open and close DB connections on-demand. Previously, we used to leave the DB connection open while the cluster was registered with the operator, potentially resutling in dangled connections if the operator terminates abnormally. Small refactoring around the role syncing code.
This commit is contained in:
@@ -415,10 +415,7 @@ func (c *Cluster) deleteSecret(secret *v1.Secret) error {
|
||||
return err
|
||||
}
|
||||
|
||||
func (c *Cluster) createUsers() (err error) {
|
||||
func (c *Cluster) createRoles() (err error) {
|
||||
// TODO: figure out what to do with duplicate names (humans and robots) among pgUsers
|
||||
reqs := c.userSyncStrategy.ProduceSyncRequests(nil, c.pgUsers)
|
||||
err = c.userSyncStrategy.ExecuteSyncRequests(reqs, c.pgDb)
|
||||
|
||||
return err
|
||||
return c.syncRoles(false)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user