Skip to content
This repository has been archived by the owner on Feb 22, 2022. It is now read-only.

Commit

Permalink
[stable/postgresql] Use tpl so release name can be used in config maps (
Browse files Browse the repository at this point in the history
#13705)

* Use tpl so release name can be used in config maps

This runs the config map name through tpl so that templating can be
used with config map and secret names in postgres. Otherwise, it limits
postgres to a single release when using a custom config map name.
This is a workaround for issue: helm/helm#2492
and follows similar solutions used elsewhere:
#10342

Signed-off-by: Nuwan Goonasekera <2070605+nuwang@users.noreply.github.com>

* Bump chart version

Signed-off-by: Nuwan Goonasekera <2070605+nuwang@users.noreply.github.com>

* Update docs to indicate that the value is evaluated as a template

Signed-off-by: Nuwan Goonasekera <2070605+nuwang@users.noreply.github.com>
  • Loading branch information
nuwang authored and k8s-ci-robot committed May 14, 2019
1 parent 10d07e6 commit 1238721
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion stable/postgresql/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v1
name: postgresql
version: 4.0.2
version: 4.0.3
appVersion: 10.7.0
description: Chart for PostgreSQL, an object-relational database management system (ORDBMS) with an emphasis on extensibility and on standards-compliance.
keywords:
Expand Down
10 changes: 5 additions & 5 deletions stable/postgresql/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,11 @@ The following tables lists the configurable parameters of the PostgreSQL chart a
| `postgresqlConfiguration` | Runtime Config Parameters | `nil` |
| `postgresqlExtendedConf` | Extended Runtime Config Parameters (appended to main or default configuration) | `nil` |
| `pgHbaConfiguration` | Content of pg\_hba.conf | `nil (do not create pg_hba.conf)` |
| `configurationConfigMap` | ConfigMap with the PostgreSQL configuration files (Note: Overrides `postgresqlConfiguration` and `pgHbaConfiguration`) | `nil` |
| `extendedConfConfigMap` | ConfigMap with the extended PostgreSQL configuration files | `nil` |
| `initdbScripts` | Dictionary of initdb scripts | `nil` |
| `initdbScriptsConfigMap` | ConfigMap with the initdb scripts (Note: Overrides `initdbScripts`) | `nil` |
| `initdbScriptsSecret` | Secret with initdb scripts that contain sensitive information (Note: can be used with `initdbScriptsConfigMap` or `initdbScripts`) | `nil` |
| `configurationConfigMap` | ConfigMap with the PostgreSQL configuration files (Note: Overrides `postgresqlConfiguration` and `pgHbaConfiguration`). The value is evaluated as a template. | `nil` |
| `extendedConfConfigMap` | ConfigMap with the extended PostgreSQL configuration files. The value is evaluated as a template. | `nil` |
| `initdbScripts` | Dictionary of initdb scripts | `nil` |
| `initdbScriptsConfigMap` | ConfigMap with the initdb scripts (Note: Overrides `initdbScripts`). The value is evaluated as a template. | `nil` |
| `initdbScriptsSecret` | Secret with initdb scripts that contain sensitive information (Note: can be used with `initdbScriptsConfigMap` or `initdbScripts`). The value is evaluated as a template. | `nil` |
| `service.type` | Kubernetes Service type | `ClusterIP` |
| `service.port` | PostgreSQL port | `5432` |
| `service.nodePort` | Kubernetes Service nodePort | `nil` |
Expand Down
8 changes: 4 additions & 4 deletions stable/postgresql/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ Get the configuration ConfigMap name.
*/}}
{{- define "postgresql.configurationCM" -}}
{{- if .Values.configurationConfigMap -}}
{{- printf "%s" .Values.configurationConfigMap -}}
{{- printf "%s" (tpl .Values.configurationConfigMap $) -}}
{{- else -}}
{{- printf "%s-configuration" (include "postgresql.fullname" .) -}}
{{- end -}}
Expand All @@ -231,7 +231,7 @@ Get the extended configuration ConfigMap name.
*/}}
{{- define "postgresql.extendedConfigurationCM" -}}
{{- if .Values.extendedConfConfigMap -}}
{{- printf "%s" .Values.extendedConfConfigMap -}}
{{- printf "%s" (tpl .Values.extendedConfConfigMap $) -}}
{{- else -}}
{{- printf "%s-extended-configuration" (include "postgresql.fullname" .) -}}
{{- end -}}
Expand All @@ -242,7 +242,7 @@ Get the initialization scripts ConfigMap name.
*/}}
{{- define "postgresql.initdbScriptsCM" -}}
{{- if .Values.initdbScriptsConfigMap -}}
{{- printf "%s" .Values.initdbScriptsConfigMap -}}
{{- printf "%s" (tpl .Values.initdbScriptsConfigMap $) -}}
{{- else -}}
{{- printf "%s-init-scripts" (include "postgresql.fullname" .) -}}
{{- end -}}
Expand All @@ -252,7 +252,7 @@ Get the initialization scripts ConfigMap name.
Get the initialization scripts Secret name.
*/}}
{{- define "postgresql.initdbScriptsSecret" -}}
{{- printf "%s" .Values.initdbScriptsSecret -}}
{{- printf "%s" (tpl .Values.initdbScriptsSecret $) -}}
{{- end -}}

{{/*
Expand Down

0 comments on commit 1238721

Please sign in to comment.