mirror of
https://github.com/zalando/postgres-operator.git
synced 2026-10-09 05:58:16 +02:00
improve pooler sync (#1593)
* remove role from installLookupFunction and run it on database sync, too * fix condition to decide on syncing pooler * trigger lookup from database sync only if pooler is set * use empty spec everywhere and do not sync if one lookupfunction was passed * do not sync pooler after being disabled
This commit is contained in:
@@ -508,7 +508,7 @@ func (c *Cluster) execCreateOrAlterExtension(extName, schemaName, statement, doi
|
||||
|
||||
// Creates a connection pool credentials lookup function in every database to
|
||||
// perform remote authentication.
|
||||
func (c *Cluster) installLookupFunction(poolerSchema, poolerUser string, role PostgresRole) error {
|
||||
func (c *Cluster) installLookupFunction(poolerSchema, poolerUser string) error {
|
||||
var stmtBytes bytes.Buffer
|
||||
|
||||
c.logger.Info("Installing lookup function")
|
||||
@@ -604,8 +604,8 @@ func (c *Cluster) installLookupFunction(poolerSchema, poolerUser string, role Po
|
||||
c.logger.Infof("pooler lookup function installed into %s", dbname)
|
||||
}
|
||||
|
||||
if len(failedDatabases) == 0 {
|
||||
c.ConnectionPooler[role].LookupFunction = true
|
||||
if len(failedDatabases) > 0 {
|
||||
return fmt.Errorf("could not install pooler lookup function in every specified databases")
|
||||
}
|
||||
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user