From e85c21af61669ba632feeefd123fff7f96c71a49 Mon Sep 17 00:00:00 2001 From: Dmitrii Dolgov <9erthalion6@gmail.com> Date: Mon, 3 Aug 2020 15:58:05 +0200 Subject: [PATCH] Hide template This parameter should be a detail of internal implementation and only facilitate compatibility with the legacy behaviour if we want to recommend only using the new format. --- manifests/configmap.yaml | 2 +- manifests/postgresql-operator-default-configuration.yaml | 2 -- pkg/controller/util.go | 6 +----- 3 files changed, 2 insertions(+), 8 deletions(-) diff --git a/manifests/configmap.yaml b/manifests/configmap.yaml index 78dd470bd..1210d5015 100644 --- a/manifests/configmap.yaml +++ b/manifests/configmap.yaml @@ -48,7 +48,7 @@ data: # gcp_credentials: "" # kubernetes_use_configmaps: "false" # infrastructure_roles_secret_name: "postgresql-infrastructure-roles" - # infrastructure_roles_secrets: "secretname:monitoring-roles,userkey:user,passwordkey:password,rolekey:inrole,template:true" + # infrastructure_roles_secrets: "secretname:monitoring-roles,userkey:user,passwordkey:password,rolekey:inrole" # inherited_labels: application,environment # kube_iam_role: "" # log_s3_bucket: "" diff --git a/manifests/postgresql-operator-default-configuration.yaml b/manifests/postgresql-operator-default-configuration.yaml index c0ebe29a2..c0dce42ee 100644 --- a/manifests/postgresql-operator-default-configuration.yaml +++ b/manifests/postgresql-operator-default-configuration.yaml @@ -44,11 +44,9 @@ configuration: # userkey: "user" # passwordkey: "password" # rolekey: "inrole" - # template: true # - secretname: "other-infrastructure-role" # userkey: "other-user-key" # passwordkey: "other-password-key" - # template: false # inherited_labels: # - application # - environment diff --git a/pkg/controller/util.go b/pkg/controller/util.go index c87d4745c..6035903dd 100644 --- a/pkg/controller/util.go +++ b/pkg/controller/util.go @@ -4,7 +4,6 @@ import ( "context" "encoding/json" "fmt" - "strconv" "strings" v1 "k8s.io/api/core/v1" @@ -141,6 +140,7 @@ func (c *Controller) getInfrastructureRoleDefinitions() []*config.Infrastructure // The field contains the format in which secret is written, let's // convert it to a proper definition properties := strings.Split(c.opConfig.InfrastructureRolesDefs, propertySep) + roleDef = config.InfrastructureRole{Template: false} for _, property := range properties { values := strings.Split(property, valueSep) @@ -163,10 +163,6 @@ func (c *Controller) getInfrastructureRoleDefinitions() []*config.Infrastructure roleDef.PasswordKey = value case "rolekey": roleDef.RoleKey = value - case "template": - if roleDef.Template, err = strconv.ParseBool(value); err != nil { - c.logger.Warningf("Could not extract template information %s: %v", value, err) - } default: c.logger.Warningf("Role description is not known: %s", properties) }