mirror of
https://github.com/zalando/postgres-operator.git
synced 2026-09-30 10:11:49 +02:00
fix searching for users with namespace in name (#1569)
* fix searching for users with namespace in name and improve e2e test * remove reformatting username to query
This commit is contained in:
@@ -386,7 +386,6 @@ func (c *Cluster) syncStatefulSet() error {
|
||||
return fmt.Errorf("could not set cluster-wide PostgreSQL configuration options: %v", err)
|
||||
}
|
||||
|
||||
|
||||
if instancesRestartRequired {
|
||||
c.logger.Debugln("restarting Postgres server within pods")
|
||||
c.eventRecorder.Event(c.GetReference(), v1.EventTypeNormal, "Update", "restarting Postgres server within pods")
|
||||
@@ -623,11 +622,6 @@ func (c *Cluster) syncRoles() (err error) {
|
||||
// create list of database roles to query
|
||||
for _, u := range c.pgUsers {
|
||||
pgRole := u.Name
|
||||
if u.Namespace != c.Namespace && u.Namespace != "" {
|
||||
// to avoid the conflict of having multiple users of same name
|
||||
// but each in different namespace.
|
||||
pgRole = fmt.Sprintf("%s.%s", u.Name, u.Namespace)
|
||||
}
|
||||
userNames = append(userNames, pgRole)
|
||||
// add team member role name with rename suffix in case we need to rename it back
|
||||
if u.Origin == spec.RoleOriginTeamsAPI && c.OpConfig.EnableTeamMemberDeprecation {
|
||||
|
||||
Reference in New Issue
Block a user