From cc1cf6ffb573f66604f4c6bcca3a12932953abcc Mon Sep 17 00:00:00 2001
From: Michael Koch <michael.koch@open-xchange.com>
Date: Fri, 4 Feb 2022 10:59:28 +0100
Subject: [PATCH] CTR-216 Make configMap creation optional

---
 helm/core-manifest-service/Chart.lock                | 6 +++---
 helm/core-manifest-service/Chart.yaml                | 2 +-
 helm/core-manifest-service/templates/configMap.yaml  | 2 ++
 helm/core-manifest-service/templates/deployment.yaml | 2 +-
 4 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/helm/core-manifest-service/Chart.lock b/helm/core-manifest-service/Chart.lock
index 97b5d6a..36e78e2 100644
--- a/helm/core-manifest-service/Chart.lock
+++ b/helm/core-manifest-service/Chart.lock
@@ -1,6 +1,6 @@
 dependencies:
 - name: ox-common
   repository: oci://registry.open-xchange.com/common/charts
-  version: 1.0.13
-digest: sha256:52b19d958411d91eabf30266f594ab6b2a4b76997c4c93d6c6bb4a28d64ca716
-generated: "2022-01-27T10:44:48.784704+01:00"
+  version: 1.0.17
+digest: sha256:0ab9e19964f4c46bbe7bfc5ffff6b086b92f2309f1ae895fc814945b7b95ee9c
+generated: "2022-02-04T10:54:27.434320472+01:00"
diff --git a/helm/core-manifest-service/Chart.yaml b/helm/core-manifest-service/Chart.yaml
index 7ba511c..117773a 100644
--- a/helm/core-manifest-service/Chart.yaml
+++ b/helm/core-manifest-service/Chart.yaml
@@ -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: 2.0.4
+version: 2.0.5
 
 # 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
diff --git a/helm/core-manifest-service/templates/configMap.yaml b/helm/core-manifest-service/templates/configMap.yaml
index 9a09801..94bcef7 100644
--- a/helm/core-manifest-service/templates/configMap.yaml
+++ b/helm/core-manifest-service/templates/configMap.yaml
@@ -1,3 +1,4 @@
+{{- if (not .Values.existingConfigMap) -}}
 apiVersion: v1
 kind: ConfigMap
 metadata:
@@ -6,3 +7,4 @@ data:
   urls.yaml: |
     manifests:
       {{- toYaml .Values.manifests | nindent 6 }}
+{{- end }}
diff --git a/helm/core-manifest-service/templates/deployment.yaml b/helm/core-manifest-service/templates/deployment.yaml
index b339b5f..dd7d259 100644
--- a/helm/core-manifest-service/templates/deployment.yaml
+++ b/helm/core-manifest-service/templates/deployment.yaml
@@ -53,5 +53,5 @@ spec:
       volumes:
         - name: manifest-config
           configMap:
-            name: {{ include "ox-common.names.fullname" . }}
+            name: {{ .Values.existingConfigMap | default (include "ox-common.names.fullname" .) }}
 
-- 
GitLab