From 61225998ff6227bc9d58f97e8469ccc5ad6f6739 Mon Sep 17 00:00:00 2001 From: Felix Kunde Date: Thu, 22 Oct 2020 09:25:25 +0200 Subject: [PATCH] reflect some feedback --- charts/postgres-operator/crds/postgresteams.yaml | 6 +++--- manifests/postgresteam.crd.yaml | 6 +++--- pkg/cluster/cluster.go | 6 +++--- pkg/util/util_test.go | 1 + 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/charts/postgres-operator/crds/postgresteams.yaml b/charts/postgres-operator/crds/postgresteams.yaml index 5b9518576..4f2e74034 100644 --- a/charts/postgres-operator/crds/postgresteams.yaml +++ b/charts/postgres-operator/crds/postgresteams.yaml @@ -40,7 +40,7 @@ spec: properties: additionalSuperuserTeams: type: object - description: "Map for teamId and associted additional superuser teams" + description: "Map for teamId and associated additional superuser teams" additionalProperties: type: array nullable: true @@ -49,7 +49,7 @@ spec: type: string additionalTeams: type: object - description: "Map for teamId and associted additional teams" + description: "Map for teamId and associated additional teams" additionalProperties: type: array nullable: true @@ -58,7 +58,7 @@ spec: type: string additionalMembers: type: object - description: "Map for teamId and associted additional users" + description: "Map for teamId and associated additional users" additionalProperties: type: array nullable: true diff --git a/manifests/postgresteam.crd.yaml b/manifests/postgresteam.crd.yaml index 012fc2fea..5f55bdfcb 100644 --- a/manifests/postgresteam.crd.yaml +++ b/manifests/postgresteam.crd.yaml @@ -36,7 +36,7 @@ spec: properties: additionalSuperuserTeams: type: object - description: "Map for teamId and associted additional superuser teams" + description: "Map for teamId and associated additional superuser teams" additionalProperties: type: array nullable: true @@ -45,7 +45,7 @@ spec: type: string additionalTeams: type: object - description: "Map for teamId and associted additional teams" + description: "Map for teamId and associated additional teams" additionalProperties: type: array nullable: true @@ -54,7 +54,7 @@ spec: type: string additionalMembers: type: object - description: "Map for teamId and associted additional users" + description: "Map for teamId and associated additional users" additionalProperties: type: array nullable: true diff --git a/pkg/cluster/cluster.go b/pkg/cluster/cluster.go index ebf445cf2..ac96be872 100644 --- a/pkg/cluster/cluster.go +++ b/pkg/cluster/cluster.go @@ -1141,7 +1141,7 @@ func (c *Cluster) initHumanUsers() error { for _, superuserTeam := range superuserTeams { err := c.initTeamMembers(superuserTeam, true) 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 { clusterIsOwnedBySuperuserTeam = true @@ -1153,7 +1153,7 @@ func (c *Cluster) initHumanUsers() error { if !(util.SliceContains(superuserTeams, additionalTeam)) { err := c.initTeamMembers(additionalTeam, false) 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) 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 diff --git a/pkg/util/util_test.go b/pkg/util/util_test.go index 6cf179033..b64f457de 100644 --- a/pkg/util/util_test.go +++ b/pkg/util/util_test.go @@ -51,6 +51,7 @@ var isEqualIgnoreOrderTest = []struct { {[]string{"a", "b", "c"}, []string{"a", "b", "c"}, true}, {[]string{"a", "b", "c"}, []string{"a", "c", "b"}, true}, {[]string{"a", "b"}, []string{"a", "c", "b"}, false}, + {[]string{"a", "b", "c"}, []string{"a", "d", "c"}, true}, } var substractTest = []struct {