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:
Felix Kunde
2021-07-27 09:46:55 +02:00
committed by GitHub
parent b1fab703ee
commit 58bab073da
2 changed files with 11 additions and 24 deletions
-6
View File
@@ -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 {