mirror of
https://github.com/zalando/postgres-operator.git
synced 2026-10-04 08:21:44 +02:00
Allow global configuration options for API roles.
Add options to the PgUser structure, potentially allowing to set per-role options in the cluster definition as well. Introduce api_roles_configuration operator option with the default of log_statement=all
This commit is contained in:
@@ -645,7 +645,12 @@ func (c *Cluster) initHumanUsers() error {
|
||||
}
|
||||
}
|
||||
|
||||
c.pgUsers[username] = spec.PgUser{Name: username, Flags: flags, MemberOf: memberOf}
|
||||
c.pgUsers[username] = spec.PgUser{
|
||||
Name: username,
|
||||
Flags: flags,
|
||||
MemberOf: memberOf,
|
||||
Parameters: c.OpConfig.APIRolesParameters,
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
|
||||
+5
-1
@@ -359,7 +359,11 @@ func (c *Cluster) syncRoles(readFromDatabase bool) error {
|
||||
if err != nil {
|
||||
return fmt.Errorf("could not init db connection: %v", err)
|
||||
}
|
||||
defer c.closeDbConn()
|
||||
defer func() {
|
||||
if err := c.closeDbConn(); err != nil {
|
||||
c.logger.Errorf("could not close db connection: %v", err)
|
||||
}
|
||||
}()
|
||||
|
||||
if readFromDatabase {
|
||||
for _, u := range c.pgUsers {
|
||||
|
||||
Reference in New Issue
Block a user