only extract if rolesDefs is empty

This commit is contained in:
Felix Kunde 2020-08-07 23:18:26 +02:00
parent 45b2fa03e8
commit 62509eb7b9
2 changed files with 2 additions and 1 deletions

View File

@ -52,6 +52,7 @@ class EndToEndTestCase(unittest.TestCase):
for filename in ["operator-service-account-rbac.yaml",
"configmap.yaml",
"postgres-operator.yaml",
"infrastructure-roles.yaml",
"infrastructure-roles-new.yaml"]:
result = k8s.create_with_kubectl("manifests/" + filename)
print("stdout: {}, stderr: {}".format(result.stdout, result.stderr))

View File

@ -124,7 +124,7 @@ func (c *Controller) getInfrastructureRoleDefinitions() []*config.Infrastructure
rolesDefs := c.opConfig.InfrastructureRoles
// check if we can extract something from the configmap config option
if c.opConfig.InfrastructureRolesDefs != "" {
if len(rolesDefs) == 0 && c.opConfig.InfrastructureRolesDefs != "" {
// The configmap option could contain either a role description (in the
// form key1: value1, key2: value2), which has to be used together with
// an old secret name.