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.
This commit is contained in:
Dmitrii Dolgov 2020-08-03 15:58:05 +02:00
parent 602f26c0ce
commit e85c21af61
3 changed files with 2 additions and 8 deletions

View File

@ -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: ""

View File

@ -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

View File

@ -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)
}