From 51f193207b998db7a8d26aa1c444865d5a956771 Mon Sep 17 00:00:00 2001 From: Shaun Turner Date: Tue, 1 Oct 2024 12:06:19 +0000 Subject: [PATCH] generated config maps programatically instead of manually --- templates/deployment-configuration.yaml | 33 ++++++------------------- templates/deployment-namespaces.yaml | 20 ++++----------- 2 files changed, 13 insertions(+), 40 deletions(-) diff --git a/templates/deployment-configuration.yaml b/templates/deployment-configuration.yaml index c0964ac..d2d81af 100644 --- a/templates/deployment-configuration.yaml +++ b/templates/deployment-configuration.yaml @@ -5,30 +5,13 @@ metadata: data: environment_dns_prefix: {{ .Values.dns.prefix }} environment_dns_suffix: {{ .Values.naming.suffix }} - ohdsi_branch: "{{ .Values.components.ohdsi.repository.branch }}" - ohdsi_chart_version: "{{ .Values.components.ohdsi.chart_version }}" - secrets_distributor_chart_version: "{{ .Values.components.secrets_distributor.chart_version }}" - secrets_distributor_branch: "{{ .Values.components.secrets_distributor.repository.branch }}" - certmanager_branch: "{{ .Values.components.cert_manager.repository.branch }}" - certmanager_chart_version: "{{ .Values.components.cert_manager.chart_version }}" - trustmanager_chart_version: "{{ .Values.components.trust_manager.chart_version }}" - github_runner_branch: "{{ .Values.components.github_runner.repository.branch }}" - github_runner_chart_version: "{{ .Values.components.github_runner.chart_version }}" - aks_dns_chart_version: "{{ .Values.components.aks_dns.chart_version }}" - nginx_branch: "{{ .Values.components.ingress_nginx.repository.branch }}" - nginx_chart_version: "{{ .Values.components.ingress_nginx.chart_version }}" - keda_branch: "{{ .Values.components.keda.repository.branch }}" - keda_chart_version: "{{ .Values.components.keda.chart_version }}" - jupyter_branch: "{{ .Values.components.jupyter_hub.repository.branch }}" - jupyter_chart_version: "{{ .Values.components.jupyter_hub.chart_version }}" - analytics_workspace_management_chart_version: "{{ .Values.components.analytics_workspace_management.chart_version }}" - analytics_workspace_management_branch: "{{ .Values.components.analytics_workspace_management.repository.branch }}" - metrics_server_chart_version: "{{ .Values.components.metrics_server.chart_version }}" - guacamole_chart_version: "{{ .Values.components.guacamole.chart_version }}" - guacamole_branch: "{{ .Values.components.guacamole.repository.branch }}" - rabbitmq_chart_version: "{{ .Values.components.rabbitmq.chart_version }}" - rabbitmq_branch: "{{ .Values.components.rabbitmq.repository.branch }}" - observability_metrics_version: "{{ .Values.components.observability_metrics.chart_version }}" - observability_metrics_branch: "{{ .Values.components.observability_metrics.repository.branch }}" +{{ range $key, $value := .Values.components }} +{{ if hasKey $value "branch"}} + {{ $key }}_branch: {{ $value.branch }} +{{ end }} +{{ if hasKey $value "chart_version"}} + {{ $key }}_char_version: {{ $value.branch }} +{{ end }} +{{ end }} \ No newline at end of file diff --git a/templates/deployment-namespaces.yaml b/templates/deployment-namespaces.yaml index fb23f26..852c19a 100644 --- a/templates/deployment-namespaces.yaml +++ b/templates/deployment-namespaces.yaml @@ -3,18 +3,8 @@ kind: ConfigMap metadata: name: {{ printf "deployment-namespaces%s" .Values.naming.suffix }} data: - ohdsi_namespace: {{ .Values.components.ohdsi.namespace }} - secrets_distributor_namespace: {{ .Values.components.secrets_distributor.namespace }} - certmanager_namespace: {{ .Values.components.cert_manager.namespace }} - trustmanager_namespace: {{ .Values.components.trust_manager.namespace }} - github_runner_namespace: {{ .Values.components.github_runner.namespace }} - aks_dns_namespace: {{ .Values.components.aks_dns.namespace }} - nginx_namespace: {{ .Values.components.ingress_nginx.namespace }} - keda_namespace: {{ .Values.components.keda.namespace }} - jupyter_namespace: {{ .Values.components.jupyter_hub.namespace }} - analytics_workspace_management_namespace: {{ .Values.components.analytics_workspace_management.namespace }} - metrics_server_namespace: {{ .Values.components.metrics_server.namespace }} - guacamole_namespace: {{ .Values.components.guacamole.namespace }} - superset_namespace: {{ .Values.components.superset.namespace }} - rabbitmq_namespace: {{ .Values.components.rabbitmq.namespace }} - observability_metrics_namespace: {{ .Values.components.observability_metrics.namespace }} \ No newline at end of file +{{ range $key, $value := .Values.components }} +{{ if hasKey $value "namespace"}} + {{ $key }}_namespace: {{ $value.namespace }} +{{ end }} +{{ end }} \ No newline at end of file