reflect some feedback

This commit is contained in:
Felix Kunde 2020-10-22 09:25:25 +02:00
parent 3e7e99039b
commit 61225998ff
4 changed files with 10 additions and 9 deletions

View File

@ -40,7 +40,7 @@ spec:
properties: properties:
additionalSuperuserTeams: additionalSuperuserTeams:
type: object type: object
description: "Map for teamId and associted additional superuser teams" description: "Map for teamId and associated additional superuser teams"
additionalProperties: additionalProperties:
type: array type: array
nullable: true nullable: true
@ -49,7 +49,7 @@ spec:
type: string type: string
additionalTeams: additionalTeams:
type: object type: object
description: "Map for teamId and associted additional teams" description: "Map for teamId and associated additional teams"
additionalProperties: additionalProperties:
type: array type: array
nullable: true nullable: true
@ -58,7 +58,7 @@ spec:
type: string type: string
additionalMembers: additionalMembers:
type: object type: object
description: "Map for teamId and associted additional users" description: "Map for teamId and associated additional users"
additionalProperties: additionalProperties:
type: array type: array
nullable: true nullable: true

View File

@ -36,7 +36,7 @@ spec:
properties: properties:
additionalSuperuserTeams: additionalSuperuserTeams:
type: object type: object
description: "Map for teamId and associted additional superuser teams" description: "Map for teamId and associated additional superuser teams"
additionalProperties: additionalProperties:
type: array type: array
nullable: true nullable: true
@ -45,7 +45,7 @@ spec:
type: string type: string
additionalTeams: additionalTeams:
type: object type: object
description: "Map for teamId and associted additional teams" description: "Map for teamId and associated additional teams"
additionalProperties: additionalProperties:
type: array type: array
nullable: true nullable: true
@ -54,7 +54,7 @@ spec:
type: string type: string
additionalMembers: additionalMembers:
type: object type: object
description: "Map for teamId and associted additional users" description: "Map for teamId and associated additional users"
additionalProperties: additionalProperties:
type: array type: array
nullable: true nullable: true

View File

@ -1141,7 +1141,7 @@ func (c *Cluster) initHumanUsers() error {
for _, superuserTeam := range superuserTeams { for _, superuserTeam := range superuserTeams {
err := c.initTeamMembers(superuserTeam, true) err := c.initTeamMembers(superuserTeam, true)
if err != nil { if err != nil {
return fmt.Errorf("Cannot create team %q of Postgres superusers: %v", superuserTeam, err) return fmt.Errorf("Cannot initialize members for team %q of Postgres superusers: %v", superuserTeam, err)
} }
if superuserTeam == c.Spec.TeamID { if superuserTeam == c.Spec.TeamID {
clusterIsOwnedBySuperuserTeam = true clusterIsOwnedBySuperuserTeam = true
@ -1153,7 +1153,7 @@ func (c *Cluster) initHumanUsers() error {
if !(util.SliceContains(superuserTeams, additionalTeam)) { if !(util.SliceContains(superuserTeams, additionalTeam)) {
err := c.initTeamMembers(additionalTeam, false) err := c.initTeamMembers(additionalTeam, false)
if err != nil { if err != nil {
return fmt.Errorf("Cannot create additional team %q for cluster owner by %q: %v", additionalTeam, c.Spec.TeamID, err) return fmt.Errorf("Cannot initialize members for additional team %q for cluster owned by %q: %v", additionalTeam, c.Spec.TeamID, err)
} }
} }
} }
@ -1165,7 +1165,7 @@ func (c *Cluster) initHumanUsers() error {
err := c.initTeamMembers(c.Spec.TeamID, false) err := c.initTeamMembers(c.Spec.TeamID, false)
if err != nil { if err != nil {
return fmt.Errorf("Cannot create a team %q of admins owning the PG cluster: %v", c.Spec.TeamID, err) return fmt.Errorf("Cannot initialize members for team %q who owns the Postgres cluster: %v", c.Spec.TeamID, err)
} }
return nil return nil

View File

@ -51,6 +51,7 @@ var isEqualIgnoreOrderTest = []struct {
{[]string{"a", "b", "c"}, []string{"a", "b", "c"}, true}, {[]string{"a", "b", "c"}, []string{"a", "b", "c"}, true},
{[]string{"a", "b", "c"}, []string{"a", "c", "b"}, true}, {[]string{"a", "b", "c"}, []string{"a", "c", "b"}, true},
{[]string{"a", "b"}, []string{"a", "c", "b"}, false}, {[]string{"a", "b"}, []string{"a", "c", "b"}, false},
{[]string{"a", "b", "c"}, []string{"a", "d", "c"}, true},
} }
var substractTest = []struct { var substractTest = []struct {