From 871041b2f1dfca4de56e4c633fad10b0ee652eac Mon Sep 17 00:00:00 2001 From: Saurabh Lohe <105858985+slohe1@users.noreply.github.com> Date: Tue, 1 Aug 2023 17:46:43 +0530 Subject: [PATCH] OPSEXP-2116 fixup chart alfresco-connector-ms365 (#87) --- charts/alfresco-connector-ms365/Chart.yaml | 2 +- charts/alfresco-connector-ms365/README.md | 2 +- .../templates/deployment-connector-ms365.yaml | 16 ++++++++-------- .../tests/deployment-connector-ms365_test.yaml | 16 ++++++++++++++-- 4 files changed, 24 insertions(+), 12 deletions(-) diff --git a/charts/alfresco-connector-ms365/Chart.yaml b/charts/alfresco-connector-ms365/Chart.yaml index 0c9e40d9..be8ab9d3 100644 --- a/charts/alfresco-connector-ms365/Chart.yaml +++ b/charts/alfresco-connector-ms365/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: alfresco-connector-ms365 description: A Helm chart for deploying Alfresco connector ms365 service type: application -version: 0.3.2 +version: 0.3.3 appVersion: "2.0.0" dependencies: - name: alfresco-common diff --git a/charts/alfresco-connector-ms365/README.md b/charts/alfresco-connector-ms365/README.md index 09b601a8..ad1399dc 100644 --- a/charts/alfresco-connector-ms365/README.md +++ b/charts/alfresco-connector-ms365/README.md @@ -1,6 +1,6 @@ # alfresco-connector-ms365 -![Version: 0.3.2](https://img.shields.io/badge/Version-0.3.2-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 2.0.0](https://img.shields.io/badge/AppVersion-2.0.0-informational?style=flat-square) +![Version: 0.3.3](https://img.shields.io/badge/Version-0.3.3-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 2.0.0](https://img.shields.io/badge/AppVersion-2.0.0-informational?style=flat-square) A Helm chart for deploying Alfresco connector ms365 service diff --git a/charts/alfresco-connector-ms365/templates/deployment-connector-ms365.yaml b/charts/alfresco-connector-ms365/templates/deployment-connector-ms365.yaml index 56b247ae..311d76f0 100644 --- a/charts/alfresco-connector-ms365/templates/deployment-connector-ms365.yaml +++ b/charts/alfresco-connector-ms365/templates/deployment-connector-ms365.yaml @@ -63,15 +63,8 @@ spec: imagePullPolicy: {{ .Values.image.pullPolicy }} {{- include "component-security-context" .Values | indent 8 }} {{- $repo_details_cm := .Values.repository.existingConfigMap.name | default (include "alfresco-connector-ms365.fullname" .) }} - {{- $repo_url := printf "-Dalfresco.base-url=http://%s:%s" "$REPO_HOST" "$REPO_PORT" }} + {{- $repo_url := printf "-Dalfresco.base-url=http://%s:%s" "$(REPO_HOST)" "$(REPO_PORT)" }} env: - {{- range $key, $value := (omit .Values.environment "JAVA_OPTS") }} - - name: {{ $key }} - value: {{ $value | quote }} - {{- end }} - - name: JAVA_OPTS - value: >- - {{ (printf "%s %s" (.Values.environment.JAVA_OPTS | default "") ($repo_url)) }} - name: REPO_HOST valueFrom: configMapKeyRef: @@ -82,6 +75,13 @@ spec: configMapKeyRef: name: {{ $repo_details_cm }} key: {{ .Values.repository.existingConfigMap.keys.port }} + {{- range $key, $value := (omit .Values.environment "JAVA_OPTS") }} + - name: {{ $key }} + value: {{ $value | quote }} + {{- end }} + - name: JAVA_OPTS + value: >- + {{ (printf "%s %s" (.Values.environment.JAVA_OPTS | default "") ($repo_url)) }} ports: - containerPort: {{ .Values.image.internalPort }} resources: {{- toYaml .Values.resources | nindent 12 }} diff --git a/charts/alfresco-connector-ms365/tests/deployment-connector-ms365_test.yaml b/charts/alfresco-connector-ms365/tests/deployment-connector-ms365_test.yaml index 6d81d96a..fad4f88e 100644 --- a/charts/alfresco-connector-ms365/tests/deployment-connector-ms365_test.yaml +++ b/charts/alfresco-connector-ms365/tests/deployment-connector-ms365_test.yaml @@ -34,7 +34,7 @@ tests: name: myns/mycm asserts: - equal: - path: spec.template.spec.containers[0].env[2].valueFrom.configMapKeyRef.name + path: spec.template.spec.containers[0].env[0].valueFrom.configMapKeyRef.name value: myns/mycm template: deployment-connector-ms365.yaml @@ -44,8 +44,20 @@ tests: test_data: 80 asserts: - equal: - path: spec.template.spec.containers[0].env[0] + path: spec.template.spec.containers[0].env[2] value: name: test_data value: "80" template: deployment-connector-ms365.yaml + + - it: should set environment variables correctly with quotes + set: + environment: + JAVA_OPTS: "-Xmx 2GB" + asserts: + - equal: + path: spec.template.spec.containers[0].env[2] + value: + name: JAVA_OPTS + value: "-Xmx 2GB -Dalfresco.base-url=http://$(REPO_HOST):$(REPO_PORT)" + template: deployment-connector-ms365.yaml