mirror of
https://github.com/zalando/postgres-operator.git
synced 2026-10-05 01:24:58 +02:00
fix initHumanUsers
This commit is contained in:
@@ -1133,16 +1133,13 @@ func (c *Cluster) initHumanUsers() error {
|
||||
superuserTeams := c.PgTeamMap.GetAdditionalSuperuserTeams(c.Spec.TeamID, true)
|
||||
var clusterIsOwnedBySuperuserTeam bool
|
||||
for _, postgresSuperuserTeam := range c.OpConfig.PostgresSuperuserTeams {
|
||||
isAdditionalSuperuserTeam := false
|
||||
for _, superuserTeam := range superuserTeams {
|
||||
if postgresSuperuserTeam == superuserTeam {
|
||||
isAdditionalSuperuserTeam = true
|
||||
}
|
||||
if !(util.SliceContains(superuserTeams, postgresSuperuserTeam)) {
|
||||
superuserTeams = append(superuserTeams, postgresSuperuserTeam)
|
||||
}
|
||||
}
|
||||
|
||||
for _, superuserTeam := range superuserTeams {
|
||||
err := c.initTeamMembers(adminTeam, true)
|
||||
err := c.initTeamMembers(superuserTeam, true)
|
||||
if err != nil {
|
||||
return fmt.Errorf("Cannot create team %q of Postgres superusers: %v", superuserTeam, err)
|
||||
}
|
||||
|
||||
@@ -87,7 +87,7 @@ func (ptm *PostgresTeamMap) GetAdditionalTeams(team string, transitive bool) []s
|
||||
return ptm.fetchAdditionalTeams(team, false, transitive, []string{})
|
||||
}
|
||||
|
||||
// GetAdditionalTeams function to retrieve list of additional teams
|
||||
// GetAdditionalSuperuserTeams function to retrieve list of additional superuser teams
|
||||
func (ptm *PostgresTeamMap) GetAdditionalSuperuserTeams(team string, transitive bool) []string {
|
||||
return ptm.fetchAdditionalTeams(team, true, transitive, []string{})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user