mirror of
https://github.com/zalando/postgres-operator.git
synced 2026-10-01 08:07:04 +02:00
fix unit tests
This commit is contained in:
@@ -1170,7 +1170,6 @@ func (c *Cluster) initTeamMembers(teamID string, isPostgresSuperuserTeam bool) e
|
||||
newRole := spec.PgUser{
|
||||
Origin: spec.RoleOriginTeamsAPI,
|
||||
Name: username,
|
||||
Namespace: c.Namespace,
|
||||
Flags: flags,
|
||||
MemberOf: memberOf,
|
||||
Parameters: c.OpConfig.TeamAPIRoleConfiguration,
|
||||
|
||||
@@ -221,7 +221,7 @@ func (c *Cluster) readPgUsersFromDatabase(userNames []string) (users spec.PgUser
|
||||
roldeleted = true
|
||||
}
|
||||
|
||||
users[rolname] = spec.PgUser{Name: rolname, Namespace: c.Namespace, Password: rolpassword, Flags: flags, MemberOf: memberof, Parameters: parameters, Deleted: roldeleted}
|
||||
users[rolname] = spec.PgUser{Name: rolname, Password: rolpassword, Flags: flags, MemberOf: memberof, Parameters: parameters, Deleted: roldeleted}
|
||||
}
|
||||
|
||||
return users, nil
|
||||
|
||||
+1
-1
@@ -557,7 +557,7 @@ 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 {
|
||||
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)
|
||||
|
||||
Reference in New Issue
Block a user