mirror of
https://github.com/zalando/postgres-operator.git
synced 2026-10-09 17:36:17 +02:00
polishing and fixes
This commit is contained in:
@@ -1,11 +1,10 @@
|
||||
package v1
|
||||
|
||||
import (
|
||||
acidzalando "github.com/zalando/postgres-operator/pkg/apis/acid.zalan.do"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
|
||||
"github.com/zalando/postgres-operator/pkg/apis/acid.zalan.do"
|
||||
)
|
||||
|
||||
// APIVersion of the `postgresql` and `operator` CRDs
|
||||
@@ -44,6 +43,8 @@ func addKnownTypes(scheme *runtime.Scheme) error {
|
||||
// TODO: User uppercase CRDResourceKind of our types in the next major API version
|
||||
scheme.AddKnownTypeWithName(SchemeGroupVersion.WithKind("postgresql"), &Postgresql{})
|
||||
scheme.AddKnownTypeWithName(SchemeGroupVersion.WithKind("postgresqlList"), &PostgresqlList{})
|
||||
scheme.AddKnownTypeWithName(SchemeGroupVersion.WithKind("PostgresTeam"), &PostgresTeam{})
|
||||
scheme.AddKnownTypeWithName(SchemeGroupVersion.WithKind("PostgresTeamList"), &PostgresTeamList{})
|
||||
scheme.AddKnownTypeWithName(SchemeGroupVersion.WithKind("OperatorConfiguration"),
|
||||
&OperatorConfiguration{})
|
||||
scheme.AddKnownTypeWithName(SchemeGroupVersion.WithKind("OperatorConfigurationList"),
|
||||
|
||||
+1
-8
@@ -242,14 +242,7 @@ func (c *Cluster) getTeamMembers(teamID string) ([]string, error) {
|
||||
}
|
||||
|
||||
for _, member := range teamInfo.Members {
|
||||
contains := false
|
||||
for _, additionalMember := range members {
|
||||
if member == additionalMember {
|
||||
contains = true
|
||||
break
|
||||
}
|
||||
}
|
||||
if !(contains) {
|
||||
if !(util.SliceContains(members, member)) {
|
||||
members = append(members, member)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -396,7 +396,7 @@ func (c *Controller) getInfrastructureRole(
|
||||
}
|
||||
|
||||
func (c *Controller) loadPostgresTeams(obj interface{}) {
|
||||
var pgTeamMap teams.PostgresTeamMap
|
||||
pgTeamMap := teams.PostgresTeamMap{}
|
||||
|
||||
pgTeam, ok := obj.(*acidv1.PostgresTeam)
|
||||
if !ok {
|
||||
@@ -412,6 +412,7 @@ func (c *Controller) loadPostgresTeams(obj interface{}) {
|
||||
}
|
||||
|
||||
func (c *Controller) updatePostgresTeams(prev, obj interface{}) {
|
||||
c.logger.Debugf("reloading postgres team CRDs and overwriting cached map")
|
||||
c.loadPostgresTeams(obj)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user