Skip to content
This repository has been archived by the owner on Sep 18, 2024. It is now read-only.

Commit

Permalink
allow multiple postgres for pgadmin
Browse files Browse the repository at this point in the history
  • Loading branch information
fcomte committed Feb 8, 2021
1 parent 317eddb commit cf8d486
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion charts/pgadmin/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.2.1
version: 0.2.2

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
7 changes: 6 additions & 1 deletion charts/pgadmin/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,13 @@ nginx.ingress.kubernetes.io/whitelist-source-range: {{ .Values.security.whitelis

{{- define "pgadmin.configmap" -}}
{{ printf "{" }}
{{ printf "\"Servers\": {" | indent 2 }}
{{ printf "\"Servers\": {" | indent 2 }}
{{- $virgule := 0 }}
{{ range $index, $service := (lookup "v1" "Service" .Release.Namespace "").items }}
{{- if hasPrefix "postgres" (index $service "metadata" "labels" "helm.sh/chart") }}
{{- if $virgule }}
{{ printf "," }}
{{- end }}
{{ printf "\"%d\" :{" $index | indent 4}}
{{ printf "\"Name\": \"%s\"," $service.metadata.name | indent 6}}
{{ printf "\"Group\": \"Autodiscovery\"," | indent 6}}
Expand All @@ -87,6 +91,7 @@ nginx.ingress.kubernetes.io/whitelist-source-range: {{ .Values.security.whitelis
{{ printf "\"Username\": \"%s\"," (trimPrefix "user-" $service.metadata.namespace) | indent 6}}
{{ printf "\"SSLMode\": \"prefer\"," | indent 6 }}
{{ printf "\"MaintenanceDB\": \"postgres\"" | indent 6}}
{{- $virgule = 1}}
{{ printf "}" | indent 4}}
{{- end }}

Expand Down

0 comments on commit cf8d486

Please sign in to comment.