From 7d014d9c2fe18eee4356086502e7af019987c8ed Mon Sep 17 00:00:00 2001 From: Felix Kunde Date: Mon, 10 Aug 2020 12:35:50 +0200 Subject: [PATCH] reflect feedback --- charts/postgres-operator/crds/operatorconfigurations.yaml | 1 + manifests/infrastructure-roles-new.yaml | 2 -- manifests/operatorconfiguration.crd.yaml | 1 + pkg/apis/acid.zalan.do/v1/crds.go | 2 +- pkg/cluster/sync.go | 1 - pkg/controller/util_test.go | 3 +-- 6 files changed, 4 insertions(+), 6 deletions(-) diff --git a/charts/postgres-operator/crds/operatorconfigurations.yaml b/charts/postgres-operator/crds/operatorconfigurations.yaml index 63072c113..4dde1fc23 100644 --- a/charts/postgres-operator/crds/operatorconfigurations.yaml +++ b/charts/postgres-operator/crds/operatorconfigurations.yaml @@ -138,6 +138,7 @@ spec: type: object required: - secretname + - userkey - passwordkey properties: secretname: diff --git a/manifests/infrastructure-roles-new.yaml b/manifests/infrastructure-roles-new.yaml index 0c97df128..64b854c6a 100644 --- a/manifests/infrastructure-roles-new.yaml +++ b/manifests/infrastructure-roles-new.yaml @@ -3,8 +3,6 @@ data: # infrastructure role definition in the new format # robot_zmon_acid_monitoring_new user: cm9ib3Rfem1vbl9hY2lkX21vbml0b3JpbmdfbmV3 - # robot_zmon - memberof: cm9ib3Rfem1vbg== # foobar_new password: Zm9vYmFyX25ldw== kind: Secret diff --git a/manifests/operatorconfiguration.crd.yaml b/manifests/operatorconfiguration.crd.yaml index dd2ff72cb..95c4678a8 100644 --- a/manifests/operatorconfiguration.crd.yaml +++ b/manifests/operatorconfiguration.crd.yaml @@ -134,6 +134,7 @@ spec: type: object required: - secretname + - userkey - passwordkey properties: secretname: diff --git a/pkg/apis/acid.zalan.do/v1/crds.go b/pkg/apis/acid.zalan.do/v1/crds.go index 2317e87db..b5695bb4e 100644 --- a/pkg/apis/acid.zalan.do/v1/crds.go +++ b/pkg/apis/acid.zalan.do/v1/crds.go @@ -916,7 +916,7 @@ var OperatorConfigCRDResourceValidation = apiextv1beta1.CustomResourceValidation Items: &apiextv1beta1.JSONSchemaPropsOrArray{ Schema: &apiextv1beta1.JSONSchemaProps{ Type: "object", - Required: []string{"secretname", "passwordkey"}, + Required: []string{"secretname", "userkey", "passwordkey"}, Properties: map[string]apiextv1beta1.JSONSchemaProps{ "secretname": { Type: "string", diff --git a/pkg/cluster/sync.go b/pkg/cluster/sync.go index 056e43043..b03b5d494 100644 --- a/pkg/cluster/sync.go +++ b/pkg/cluster/sync.go @@ -500,7 +500,6 @@ func (c *Cluster) syncSecrets() error { c.logger.Warningf("secret %q does not contain the role %q", secretSpec.Name, secretUsername) continue } - c.Secrets[secret.UID] = secret c.logger.Debugf("secret %q already exists, fetching its password", util.NameFromMeta(secret.ObjectMeta)) if secretUsername == c.systemUsers[constants.SuperuserKeyName].Name { secretUsername = constants.SuperuserKeyName diff --git a/pkg/controller/util_test.go b/pkg/controller/util_test.go index 9c80d2afb..edc05d67e 100644 --- a/pkg/controller/util_test.go +++ b/pkg/controller/util_test.go @@ -339,7 +339,6 @@ func TestInfrastructureRoleDefinitions(t *testing.T) { }, UserKey: "test-user", PasswordKey: "test-password", - RoleKey: "", DefaultRoleValue: "test-role", Template: false, }, @@ -450,7 +449,7 @@ func TestInfrastructureRoleDefinitions(t *testing.T) { { []*config.InfrastructureRole{}, spec.NamespacedName{}, - "userkey: test-user, passwordkey: test-password, rolekey: test-role, template: false", + "userkey: test-user, passwordkey: test-password, rolekey: test-role", []*config.InfrastructureRole{}, }, }