From 2d5545d4e0b5e46741e31e245a62603a112f3352 Mon Sep 17 00:00:00 2001 From: Alexandre Chapellon Date: Tue, 19 Sep 2023 17:27:43 +0200 Subject: [PATCH 01/10] fix named template strating with alfresco-content-service (without an 's') --- .../templates/_helpers-ats.tpl | 10 +++++----- .../templates/_helpers-database.tpl | 4 ++-- .../templates/_helpers-message-broker.tpl | 4 ++-- .../templates/_helpers-search.tpl | 8 ++++---- .../templates/config-repository-infrastructure.yaml | 8 ++++---- .../templates/config-repository.yaml | 2 +- 6 files changed, 18 insertions(+), 18 deletions(-) diff --git a/helm/alfresco-content-services/templates/_helpers-ats.tpl b/helm/alfresco-content-services/templates/_helpers-ats.tpl index 4941d24bf..02060ba5c 100644 --- a/helm/alfresco-content-services/templates/_helpers-ats.tpl +++ b/helm/alfresco-content-services/templates/_helpers-ats.tpl @@ -1,7 +1,7 @@ {{/* Local transformers config */}} -{{- define "alfresco-content-service.localTransformConfig" -}} +{{- define "alfresco-content-services.localTransformConfig" -}} localTransform.core-aio.url= localTransform.pdfrenderer.url=http://{{ template "alfresco-transform-service.deployment-pdfrenderer.name" . }} localTransform.imagemagick.url=http://{{ template "alfresco-transform-service.deployment-imagemagick.name" . }} @@ -13,7 +13,7 @@ localTransform.misc.url=http://{{ template "alfresco-transform-service.deploymen {{/* ATS Tengines config */}} -{{- define "alfresco-content-service.tengineConfig" -}} +{{- define "alfresco-content-services.tengineConfig" -}} alfresco-pdf-renderer.url=http://{{ template "alfresco-transform-service.deployment-pdfrenderer.name" . }} img.url=http://{{ template "alfresco-transform-service.deployment-imagemagick.name" . }} jodconverter.url=http://{{ template "alfresco-transform-service.deployment-libreoffice.name" . }} @@ -24,14 +24,14 @@ transform.misc.url=http://{{ template "alfresco-transform-service.deployment-tra {{/* Get Alfresco Content Service configuration for Alfresco Transform Service */}} -{{- define "alfresco-content-service.atsConfig" -}} +{{- define "alfresco-content-services.atsConfig" -}} {{- $atsCtx := (dict "Values" (index .Values "alfresco-transform-service") "Chart" $.Chart "Release" $.Release) }} -{{ template "alfresco-content-service.localTransformConfig" $atsCtx }} +{{ template "alfresco-content-services.localTransformConfig" $atsCtx }} {{- if and $atsCtx.Values.filestore.enabled $atsCtx.Values.transformrouter.enabled }} {{- $routerCtx := (dict "Values" (dict "nameOverride" "router" ) "Chart" .Chart "Release" .Release) }} {{- $sfsCtx := (dict "Values" (dict "nameOverride" "filestore" ) "Chart" .Chart "Release" .Release) }} transform.service.url=http://{{ template "alfresco-transform-service.deployment-transform-router.name" $atsCtx }} sfs.url=http://{{ template "alfresco-transform-service.deployment-filestore.name" $atsCtx }} -{{ template "alfresco-content-service.tengineConfig" $atsCtx }} +{{ template "alfresco-content-services.tengineConfig" $atsCtx }} {{- end }} {{- end }} diff --git a/helm/alfresco-content-services/templates/_helpers-database.tpl b/helm/alfresco-content-services/templates/_helpers-database.tpl index eb6282ee0..40c10f47b 100644 --- a/helm/alfresco-content-services/templates/_helpers-database.tpl +++ b/helm/alfresco-content-services/templates/_helpers-database.tpl @@ -1,10 +1,10 @@ {{/* Compute the repository database URL -Usage: include "alfresco-content-service.database.repo" $ +Usage: include "alfresco-content-services.database.repo" $ */}} -{{- define "alfresco-content-service.database.repo" -}} +{{- define "alfresco-content-services.database.repo" -}} {{- with .Values }} {{- if and (not .database.url) (not .postgresql.enabled) }} {{- fail "You must either set database.url or postgresql.enabled" }} diff --git a/helm/alfresco-content-services/templates/_helpers-message-broker.tpl b/helm/alfresco-content-services/templates/_helpers-message-broker.tpl index f89ff15e1..22807a9e6 100644 --- a/helm/alfresco-content-services/templates/_helpers-message-broker.tpl +++ b/helm/alfresco-content-services/templates/_helpers-message-broker.tpl @@ -1,10 +1,10 @@ {{/* Compute the Message broker URL -Usage: include "alfresco-content-service.mq.url" $ +Usage: include "alfresco-content-services.mq.url" $ */}} -{{- define "alfresco-content-service.mq.url" -}} +{{- define "alfresco-content-services.mq.url" -}} {{- if .Values.activemq.enabled }} {{- printf "failover:(nio://%s-broker:61616)?timeout=3000&jms.useCompression=true" (include "content-services.activemq.fullname" .) }} {{- else }} diff --git a/helm/alfresco-content-services/templates/_helpers-search.tpl b/helm/alfresco-content-services/templates/_helpers-search.tpl index f0bed7363..62a4538df 100644 --- a/helm/alfresco-content-services/templates/_helpers-search.tpl +++ b/helm/alfresco-content-services/templates/_helpers-search.tpl @@ -1,10 +1,10 @@ {{/* Compute the search URL -Usage: include "alfresco-content-service.search.url" $ +Usage: include "alfresco-content-services.search.url" $ */}} -{{- define "alfresco-content-service.search.url" -}} +{{- define "alfresco-content-services.search.url" -}} {{- with .Values }} {{- if or .search.url $.Values.global.elasticsearch.url }} {{- .search.url | default $.Values.global.elasticsearch.url }} @@ -25,10 +25,10 @@ Usage: include "alfresco-content-service.search.url" $ {{/* Compute the search "flavor" -Usage: include "alfresco-content-service.search.flavor" $ +Usage: include "alfresco-content-services.search.flavor" $ */}} -{{- define "alfresco-content-service.search.flavor" -}} +{{- define "alfresco-content-services.search.flavor" -}} {{- with .Values }} {{- if .search.flavor }} {{- .search.flavor }} diff --git a/helm/alfresco-content-services/templates/config-repository-infrastructure.yaml b/helm/alfresco-content-services/templates/config-repository-infrastructure.yaml index 633e6d4af..394ae93b2 100644 --- a/helm/alfresco-content-services/templates/config-repository-infrastructure.yaml +++ b/helm/alfresco-content-services/templates/config-repository-infrastructure.yaml @@ -9,11 +9,11 @@ data: {{- $repoCtx := dict "Values" (index .Values "alfresco-repository") "Chart" .Chart "Release" .Release }} repo_svc_name: {{ template "alfresco-repository.fullname" $repoCtx }} repo_svc_port: {{ .Values.repository.service.externalPort | quote }} - {{- $db_url := include "alfresco-content-service.database.repo" $ }} + {{- $db_url := include "alfresco-content-services.database.repo" $ }} {{ template "alfresco-repository.db.cm" (dict "url" $db_url "driver" .Values.database.driver) }} - {{ template "alfresco-repository.mq.cm" (include "alfresco-content-service.mq.url" .) }} + {{ template "alfresco-repository.mq.cm" (include "alfresco-content-services.mq.url" .) }} {{- $search_url := "" }} - {{- $search_flavor := include "alfresco-content-service.search.flavor" . }} + {{- $search_flavor := include "alfresco-content-services.search.flavor" . }} {{- $searchCtx := dict "Values" (index .Values "alfresco-search") "Chart" .Chart "Release" .Release }} {{- if index .Values "alfresco-search" "enabled" }} {{- $search_url = printf "http://%s-solr/solr" (include "alfresco-search-service.fullname" $searchCtx) }} @@ -25,4 +25,4 @@ data: {{- if ne "noindex" $search_flavor }} SEARCH_URL: {{ $search_url }} {{- end }} - SEARCH_FLAVOR: {{ template "alfresco-content-service.search.flavor" . }} + SEARCH_FLAVOR: {{ template "alfresco-content-services.search.flavor" . }} diff --git a/helm/alfresco-content-services/templates/config-repository.yaml b/helm/alfresco-content-services/templates/config-repository.yaml index 159409929..41f84351c 100644 --- a/helm/alfresco-content-services/templates/config-repository.yaml +++ b/helm/alfresco-content-services/templates/config-repository.yaml @@ -27,7 +27,7 @@ data: transform.service.enabled={{ and .enabled $ats_for_enterprise }} {{- end }} {{- if index .Values "alfresco-transform-service" "enabled" }} - {{- include "alfresco-content-service.atsConfig" . | indent 4 }} + {{- include "alfresco-content-services.atsConfig" . | indent 4 }} {{- end }} {{/* {{- if .Values.s3connector.enabled }} From 84b908b152ab9e9409d6170dab69cd7a99860cb4 Mon Sep 17 00:00:00 2001 From: Alexandre Chapellon Date: Tue, 19 Sep 2023 17:39:16 +0200 Subject: [PATCH 02/10] remove apparently unused template --- .../templates/_helpers-elasticsearch.tpl | 11 ----------- 1 file changed, 11 deletions(-) delete mode 100644 helm/alfresco-content-services/templates/_helpers-elasticsearch.tpl diff --git a/helm/alfresco-content-services/templates/_helpers-elasticsearch.tpl b/helm/alfresco-content-services/templates/_helpers-elasticsearch.tpl deleted file mode 100644 index f30c3c7ff..000000000 --- a/helm/alfresco-content-services/templates/_helpers-elasticsearch.tpl +++ /dev/null @@ -1,11 +0,0 @@ -{{- define "repo.elasticsearch.config" -}} -{{- if eq (index .Values "alfresco-search-enterprise" "elasticsearch" "protocol" | default .Values.global.elasticsearch.protocol) "https" }} --Delasticsearch.secureComms=https -{{- end }} --Delasticsearch.host={{ index .Values "alfresco-search-enterprise" "elasticsearch" "host" | default .Values.global.elasticsearch.host }} --Delasticsearch.port={{ index .Values "alfresco-search-enterprise" "elasticsearch" "port" | default .Values.global.elasticsearch.port }} --Delasticsearch.user={{ index .Values "alfresco-search-enterprise" "elasticsearch" "user" | default .Values.global.elasticsearch.user }} --Delasticsearch.password={{ index .Values "alfresco-search-enterprise" "elasticsearch" "password" | default .Values.global.elasticsearch.password }} --Delasticsearch.createIndexIfNotExists=true --Delasticsearch.indexName={{ index .Values "alfresco-search-enterprise" "indexName" }} -{{- end -}} From ce5dfd0cb50556e72fc69e772d82f6774dd66c50 Mon Sep 17 00:00:00 2001 From: Alexandre Chapellon Date: Tue, 19 Sep 2023 17:40:15 +0200 Subject: [PATCH 03/10] remove apparently unused template --- .../templates/_helpers-ingress.tpl | 30 ------------------- 1 file changed, 30 deletions(-) delete mode 100644 helm/alfresco-content-services/templates/_helpers-ingress.tpl diff --git a/helm/alfresco-content-services/templates/_helpers-ingress.tpl b/helm/alfresco-content-services/templates/_helpers-ingress.tpl deleted file mode 100644 index dafe61bd8..000000000 --- a/helm/alfresco-content-services/templates/_helpers-ingress.tpl +++ /dev/null @@ -1,30 +0,0 @@ -{{/* -Define annotations as provided in values -*/}} -{{- define "ingress_annotations" }} -{{- range $annotation, $value := .ingress.annotations }} - {{- if ne $annotation "nginx.ingress.kubernetes.io/server-snippet" }} - {{- $annotation | nindent 4 }}: |- - {{- $value | nindent 6 }} - {{- end }} -{{- end }} -{{- end }} -{{/* -Define required annotations for secure nginx ingress -*/}} -{{- define "ingress_vhost_annotations" }} -{{- if index .ingress.annotations "nginx.ingress.kubernetes.io/server-snippet" }} - {{- range $annotation, $value := .ingress.annotations }} - {{- if eq $annotation "nginx.ingress.kubernetes.io/server-snippet" }} - nginx.ingress.kubernetes.io/server-snippet: | - {{- $value | nindent 6 }} - {{- end }} - {{- end }} -{{- else }} - nginx.ingress.kubernetes.io/server-snippet: | -{{- end }} - location ~ ^/.*/(wc)?s(ervice)?/api/solr/.*$ {return 403;} - location ~ ^/.*/proxy/.*/api/solr/.*$ {return 403;} - location ~ ^/.*/-default-/proxy/.*/api/.*$ {return 403;} - location ~ ^/.*/s/prometheus$ {return 403;} -{{- end }} From aa0e80efab96d779fe9ff8ce7dda2de165b4e3b4 Mon Sep 17 00:00:00 2001 From: Alexandre Chapellon Date: Tue, 19 Sep 2023 18:44:55 +0200 Subject: [PATCH 04/10] move BROKER_URL to infrastructure cm --- .../templates/secret-message-broker.yaml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/helm/alfresco-content-services/templates/secret-message-broker.yaml b/helm/alfresco-content-services/templates/secret-message-broker.yaml index ef50aa119..90686f488 100644 --- a/helm/alfresco-content-services/templates/secret-message-broker.yaml +++ b/helm/alfresco-content-services/templates/secret-message-broker.yaml @@ -8,12 +8,14 @@ metadata: type: Opaque data: {{- if .Values.activemq.enabled }} - BROKER_URL: {{ printf "failover:(nio://%s-broker:61616)?timeout=3000&jms.useCompression=true" (include "content-services.activemq.fullname" .) | b64enc | quote }} - BROKER_USERNAME: {{ .Values.activemq.adminUser.user | b64enc | quote }} - BROKER_PASSWORD: {{ .Values.activemq.adminUser.password | b64enc | quote }} + {{- with .Values.activemq }} + BROKER_USERNAME: {{ .adminUser.user | b64enc | quote }} + BROKER_PASSWORD: {{ .adminUser.password | b64enc | quote }} + {{- end }} {{- else }} - BROKER_URL: {{ required "Disabling in-cluster ActiveMQ requires passing (at least) messageBroker.url" .Values.messageBroker.url | b64enc | quote }} - BROKER_USERNAME: {{ .Values.messageBroker.user | b64enc | quote }} - BROKER_PASSWORD: {{ .Values.messageBroker.password | b64enc | quote }} + {{- with .Values.messageBroker}} + BROKER_USERNAME: {{ .user | b64enc | quote }} + BROKER_PASSWORD: {{ .password | b64enc | quote }} + {{- end }} {{- end }} {{- end }} From 4adb6236baab3f7fed57f2e0e2bdf10af8d78766 Mon Sep 17 00:00:00 2001 From: Alexandre Chapellon Date: Tue, 19 Sep 2023 19:36:12 +0200 Subject: [PATCH 05/10] default non unauthenticated mq for external if no redentials are provided --- .../templates/secret-message-broker.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/helm/alfresco-content-services/templates/secret-message-broker.yaml b/helm/alfresco-content-services/templates/secret-message-broker.yaml index 90686f488..62ea34ff2 100644 --- a/helm/alfresco-content-services/templates/secret-message-broker.yaml +++ b/helm/alfresco-content-services/templates/secret-message-broker.yaml @@ -14,8 +14,8 @@ data: {{- end }} {{- else }} {{- with .Values.messageBroker}} - BROKER_USERNAME: {{ .user | b64enc | quote }} - BROKER_PASSWORD: {{ .password | b64enc | quote }} + BROKER_USERNAME: {{ .user | default "" | b64enc | quote }} + BROKER_PASSWORD: {{ .password | default "" | b64enc | quote }} {{- end }} {{- end }} {{- end }} From 6abba574c2b4de98ce34d6f15bbb4813f89115f9 Mon Sep 17 00:00:00 2001 From: Alexandre Chapellon Date: Tue, 19 Sep 2023 19:43:31 +0200 Subject: [PATCH 06/10] better mq template --- .../templates/_helpers-message-broker.tpl | 5 +-- .../tests/activemq_test.yaml | 32 ++++++++++++++++--- .../tests/values/externalBroker_values.yaml | 2 +- 3 files changed, 31 insertions(+), 8 deletions(-) diff --git a/helm/alfresco-content-services/templates/_helpers-message-broker.tpl b/helm/alfresco-content-services/templates/_helpers-message-broker.tpl index 22807a9e6..59e7487b9 100644 --- a/helm/alfresco-content-services/templates/_helpers-message-broker.tpl +++ b/helm/alfresco-content-services/templates/_helpers-message-broker.tpl @@ -6,8 +6,9 @@ Usage: include "alfresco-content-services.mq.url" $ */}} {{- define "alfresco-content-services.mq.url" -}} {{- if .Values.activemq.enabled }} - {{- printf "failover:(nio://%s-broker:61616)?timeout=3000&jms.useCompression=true" (include "content-services.activemq.fullname" .) }} + {{- $mqCtx := dict "Values" .Values.activemq "Chart" .Chart "Release" .Release }} + {{- printf "failover:(nio://%s-broker:61616)?timeout=3000&jms.useCompression=true" (include "activemq.fullname" $mqCtx) }} {{- else }} - {{ required "Disabling in-cluster ActiveMQ requires passing (at least) messageBroker.url" .Values.messageBroker.url }} + {{- required "Disabling in-cluster ActiveMQ requires passing (at least) messageBroker.url" .Values.messageBroker.url }} {{- end }} {{- end }} diff --git a/helm/alfresco-content-services/tests/activemq_test.yaml b/helm/alfresco-content-services/tests/activemq_test.yaml index 4254ef2b4..2b033d2ac 100644 --- a/helm/alfresco-content-services/tests/activemq_test.yaml +++ b/helm/alfresco-content-services/tests/activemq_test.yaml @@ -1,16 +1,38 @@ -# alfresco-common is a library so can only be tested from -# another chart --- -suite: test alfresco-common library +suite: test ActiveMQ config templates: + - config-repository-infrastructure.yaml - secret-message-broker.yaml tests: - - it: should render ActiveMQ embedded secret + - it: should render default ActiveMQ values: - values/test_values.yaml + asserts: + - equal: + path: data.BROKER_URL + value: failover:(nio://RELEASE-NAME-activemq-broker:61616)?timeout=3000&jms.useCompression=true + template: config-repository-infrastructure.yaml + - equal: + path: data.BROKER_USERNAME + value: YWRtaW4= + template: secret-message-broker.yaml + - equal: + path: data.BROKER_PASSWORD + value: YWRtaW4= + template: secret-message-broker.yaml + - it: should render ActiveMQ URL from values + values: - values/externalBroker_values.yaml asserts: - equal: path: data.BROKER_URL - value: ZmFpbG92ZXIobmlvOi8vc29tZWJyb2tlcjo2MTYxNik= + value: failover:(nio://somebroker:61616) + template: config-repository-infrastructure.yaml + - equal: + path: data.BROKER_USERNAME + value: YWxmcmVzY28= + template: secret-message-broker.yaml + - equal: + path: data.BROKER_PASSWORD + value: YWxmcmVzY28= template: secret-message-broker.yaml diff --git a/helm/alfresco-content-services/tests/values/externalBroker_values.yaml b/helm/alfresco-content-services/tests/values/externalBroker_values.yaml index 2d932d5b0..23d891b57 100644 --- a/helm/alfresco-content-services/tests/values/externalBroker_values.yaml +++ b/helm/alfresco-content-services/tests/values/externalBroker_values.yaml @@ -5,6 +5,6 @@ global: activemq: enabled: false messageBroker: - url: failover(nio://somebroker:61616) + url: failover:(nio://somebroker:61616) user: alfresco password: alfresco From 9206619e59d9802046e054f67c1d0cae5b29d68a Mon Sep 17 00:00:00 2001 From: Alexandre Chapellon Date: Tue, 19 Sep 2023 19:44:30 +0200 Subject: [PATCH 07/10] remove apparently unused template --- .../templates/_helpers-legacy.tpl | 18 ------------------ .../templates/_helpers-share.tpl | 11 ----------- 2 files changed, 29 deletions(-) delete mode 100644 helm/alfresco-content-services/templates/_helpers-share.tpl diff --git a/helm/alfresco-content-services/templates/_helpers-legacy.tpl b/helm/alfresco-content-services/templates/_helpers-legacy.tpl index 04ab456e0..d1cbeaf3f 100644 --- a/helm/alfresco-content-services/templates/_helpers-legacy.tpl +++ b/helm/alfresco-content-services/templates/_helpers-legacy.tpl @@ -1,21 +1,3 @@ -{{/* -Create a default fully qualified name. -We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). -*/}} -{{- define "alfresco-content-services.fullname" -}} -{{- $name := default .Chart.Name .Values.nameOverride -}} -{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} -{{- end -}} - -{{- define "content-services.fullname" -}} -{{- template "alfresco-content-services.fullname" . }} -{{- end -}} - {{- define "content-services.chart" -}} {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" -}} {{- end }} - -{{- define "content-services.activemq.fullname" -}} -{{- $data := dict "Release" .Release "Values" .Values.activemq "Chart" (dict "Name" "activemq") }} -{{- include "activemq.fullname" $data }} -{{- end }} diff --git a/helm/alfresco-content-services/templates/_helpers-share.tpl b/helm/alfresco-content-services/templates/_helpers-share.tpl deleted file mode 100644 index fb38f858b..000000000 --- a/helm/alfresco-content-services/templates/_helpers-share.tpl +++ /dev/null @@ -1,11 +0,0 @@ -{{- define "share.selectorLabels" -}} -app: {{ template "content-services.shortname" . }}-share -release: {{ .Release.Name }} -component: share -{{- end }} - -{{- define "share.labels" -}} -chart: {{ include "content-services.chart" . }} -{{ include "share.selectorLabels" . }} -heritage: {{ .Release.Service }} -{{- end }} From 5a9d9698e17566f0f381996ba4059c6d6ff740e3 Mon Sep 17 00:00:00 2001 From: Alexandre Chapellon Date: Tue, 19 Sep 2023 19:48:14 +0200 Subject: [PATCH 08/10] remove apparently unused service --- .../templates/svc-email.yaml | 27 ------------------- 1 file changed, 27 deletions(-) delete mode 100644 helm/alfresco-content-services/templates/svc-email.yaml diff --git a/helm/alfresco-content-services/templates/svc-email.yaml b/helm/alfresco-content-services/templates/svc-email.yaml deleted file mode 100644 index 2f5b85433..000000000 --- a/helm/alfresco-content-services/templates/svc-email.yaml +++ /dev/null @@ -1,27 +0,0 @@ -{{- if and .Values.email.server.enabled .Values.email.inbound.enabled }} -# Defines the email service for the alfresco content repository app -apiVersion: v1 -kind: Service -metadata: - name: {{ template "content-services.shortname" . }}-email - labels: - {{- include "repository.labels" . | nindent 4 }} -spec: - type: LoadBalancer - externalTrafficPolicy: Local - ports: - - port: {{ .Values.email.server.port }} - targetPort: {{ .Values.email.server.port }} - name: {{ .Values.repository.service.name }}-email-inbound - protocol: TCP - - port: {{ .Values.imap.server.port }} - targetPort: {{ .Values.imap.server.port }} - name: {{ .Values.repository.service.name }}-email-imap - protocol: TCP - - port: {{ .Values.imap.server.imaps.port }} - targetPort: {{ .Values.imap.server.imaps.port }} - name: {{ .Values.repository.service.name }}-email-imap-secure - protocol: TCP - selector: - {{- include "repository.selectorLabels" . | nindent 4 }} -{{- end }} From c61e33e1de488de004208fd12718af82b43917ed Mon Sep 17 00:00:00 2001 From: Alexandre Chapellon Date: Tue, 19 Sep 2023 21:01:43 +0200 Subject: [PATCH 09/10] remove apparently unused templates --- .../templates/_helpers-legacy.tpl | 3 -- .../templates/_helpers-repository.tpl | 30 ------------- .../config-dev-log4j-properties.yaml | 19 -------- .../templates/config-email.yaml | 13 ------ .../config-repository-infrastructure.yaml | 2 +- .../templates/secret-database.yaml | 2 +- .../templates/secret-mail-password.yaml | 11 ----- .../templates/secret-message-broker.yaml | 2 +- .../templates/secret-metadata-keystore.yaml | 10 ----- .../secret-repository-properties.yaml | 2 +- .../templates/secret-repository.yaml | 11 ----- .../templates/secret-s3.yaml | 22 --------- .../tests/secret-mail-password_test.yaml | 41 ----------------- .../tests/secret-s3_test.yaml | 45 ------------------- 14 files changed, 4 insertions(+), 209 deletions(-) delete mode 100644 helm/alfresco-content-services/templates/_helpers-legacy.tpl delete mode 100644 helm/alfresco-content-services/templates/_helpers-repository.tpl delete mode 100644 helm/alfresco-content-services/templates/config-dev-log4j-properties.yaml delete mode 100644 helm/alfresco-content-services/templates/config-email.yaml delete mode 100644 helm/alfresco-content-services/templates/secret-mail-password.yaml delete mode 100644 helm/alfresco-content-services/templates/secret-metadata-keystore.yaml delete mode 100644 helm/alfresco-content-services/templates/secret-repository.yaml delete mode 100755 helm/alfresco-content-services/templates/secret-s3.yaml delete mode 100644 helm/alfresco-content-services/tests/secret-mail-password_test.yaml delete mode 100644 helm/alfresco-content-services/tests/secret-s3_test.yaml diff --git a/helm/alfresco-content-services/templates/_helpers-legacy.tpl b/helm/alfresco-content-services/templates/_helpers-legacy.tpl deleted file mode 100644 index d1cbeaf3f..000000000 --- a/helm/alfresco-content-services/templates/_helpers-legacy.tpl +++ /dev/null @@ -1,3 +0,0 @@ -{{- define "content-services.chart" -}} -{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" -}} -{{- end }} diff --git a/helm/alfresco-content-services/templates/_helpers-repository.tpl b/helm/alfresco-content-services/templates/_helpers-repository.tpl deleted file mode 100644 index 0c8b99e18..000000000 --- a/helm/alfresco-content-services/templates/_helpers-repository.tpl +++ /dev/null @@ -1,30 +0,0 @@ -{{- define "repository.selectorLabels" -}} -app: {{ template "content-services.shortname" . }}-repository -release: {{ .Release.Name }} -component: repository -{{- end }} - -{{- define "repository.labels" -}} -chart: {{ include "content-services.chart" . }} -{{ include "repository.selectorLabels" . }} -heritage: {{ .Release.Service }} -{{- end }} - -{{/* -Get Alfresco Repository Service Port ("external") -*/}} -{{- define "repository.svcPort" -}} -{{- $defaultSvcPort := 80 }} -{{- if hasKey .Values.repository "service" }} - {{- coalesce .Values.repository.service.externalPort $defaultSvcPort | int }} -{{- else }} - {{- $defaultSvcPort | int }} -{{- end }} -{{- end -}} - -{{/* -Get Alfresco Repository container Port ("internal") -*/}} -{{- define "repository.containerPort" -}} -{{- .Values.repository.image.internalPort | default 8080 | int }} -{{- end -}} diff --git a/helm/alfresco-content-services/templates/config-dev-log4j-properties.yaml b/helm/alfresco-content-services/templates/config-dev-log4j-properties.yaml deleted file mode 100644 index aa7da0058..000000000 --- a/helm/alfresco-content-services/templates/config-dev-log4j-properties.yaml +++ /dev/null @@ -1,19 +0,0 @@ -{{- if .Values.repository.extraLogStatements }} -# Defines log4j properties -apiVersion: v1 -kind: ConfigMap -metadata: - name: {{ template "alfresco.shortname" . }}-custom-log4j-properties-configmap - labels: - {{- include "repository.labels" . | nindent 4 }} -data: - custom-log4j.properties: |- - {{- range $key, $val := .Values.repository.extraLogStatements }} - log4j.logger.{{ $key }}={{ $val }} - {{- end }} - custom-log4j2.properties: |- - {{- range $key, $val := .Values.repository.extraLogStatements }} - logger.{{ $key | replace "." "-" }}.name={{ $key }} - logger.{{ $key | replace "." "-" }}.level={{ $val }} - {{- end }} -{{- end }} diff --git a/helm/alfresco-content-services/templates/config-email.yaml b/helm/alfresco-content-services/templates/config-email.yaml deleted file mode 100644 index b094235e0..000000000 --- a/helm/alfresco-content-services/templates/config-email.yaml +++ /dev/null @@ -1,13 +0,0 @@ -{{- if and .Values.email.server.enabled .Values.email.inbound.enabled }} -# Defines the email configmap for the alfresco content repository app -apiVersion: v1 -kind: ConfigMap -metadata: - name: tcp-services - labels: - {{- include "repository.labels" . | nindent 4 }} -data: - {{ .Values.email.server.port }}: "{{ .Release.Name }}/{{ template "content-services.shortname" . }}-email:{{ .Values.email.server.port }}::PROXY" - {{ .Values.imap.server.port }}: "{{ .Release.Name }}/{{ template "content-services.shortname" . }}-email:{{ .Values.imap.server.port }}::PROXY" - {{ .Values.imap.server.imaps.port }}: "{{ .Release.Name }}/{{ template "content-services.shortname" . }}-email:{{ .Values.imap.server.imaps.port }}::PROXY" -{{- end }} diff --git a/helm/alfresco-content-services/templates/config-repository-infrastructure.yaml b/helm/alfresco-content-services/templates/config-repository-infrastructure.yaml index 394ae93b2..7595561d8 100644 --- a/helm/alfresco-content-services/templates/config-repository-infrastructure.yaml +++ b/helm/alfresco-content-services/templates/config-repository-infrastructure.yaml @@ -4,7 +4,7 @@ kind: ConfigMap metadata: name: {{ .Values.infrastructure.configMapName }} labels: - {{- include "repository.labels" . | nindent 4 }} + {{- include "alfresco-content-services.labels" . | nindent 4 }} data: {{- $repoCtx := dict "Values" (index .Values "alfresco-repository") "Chart" .Chart "Release" .Release }} repo_svc_name: {{ template "alfresco-repository.fullname" $repoCtx }} diff --git a/helm/alfresco-content-services/templates/secret-database.yaml b/helm/alfresco-content-services/templates/secret-database.yaml index 3661c7d00..f14887a7c 100644 --- a/helm/alfresco-content-services/templates/secret-database.yaml +++ b/helm/alfresco-content-services/templates/secret-database.yaml @@ -4,7 +4,7 @@ kind: Secret metadata: name: {{ .Values.database.secretName }} labels: - {{- include "repository.labels" . | nindent 4 }} + {{- include "alfresco-content-services.labels" . | nindent 4 }} type: Opaque data: DATABASE_USERNAME: {{ .Values.database.user | default .Values.postgresql.auth.username | b64enc | quote }} diff --git a/helm/alfresco-content-services/templates/secret-mail-password.yaml b/helm/alfresco-content-services/templates/secret-mail-password.yaml deleted file mode 100644 index 2fa4200e5..000000000 --- a/helm/alfresco-content-services/templates/secret-mail-password.yaml +++ /dev/null @@ -1,11 +0,0 @@ -{{- if and .Values.mail.host (not .Values.mail.existingSecretName) .Values.mail.password }} -apiVersion: v1 -kind: Secret -metadata: - name: {{ template "content-services.shortname" . }}-mail-password - labels: - {{- include "repository.labels" . | nindent 4 }} -type: Opaque -data: - MAIL_PASSWORD: {{ .Values.mail.password | b64enc | quote }} -{{- end }} diff --git a/helm/alfresco-content-services/templates/secret-message-broker.yaml b/helm/alfresco-content-services/templates/secret-message-broker.yaml index 62ea34ff2..823d98d79 100644 --- a/helm/alfresco-content-services/templates/secret-message-broker.yaml +++ b/helm/alfresco-content-services/templates/secret-message-broker.yaml @@ -4,7 +4,7 @@ kind: Secret metadata: name: {{ .Values.messageBroker.secretName }} labels: - {{- include "repository.labels" . | nindent 4 }} + {{- include "alfresco-content-services.labels" . | nindent 4 }} type: Opaque data: {{- if .Values.activemq.enabled }} diff --git a/helm/alfresco-content-services/templates/secret-metadata-keystore.yaml b/helm/alfresco-content-services/templates/secret-metadata-keystore.yaml deleted file mode 100644 index d2d1196d7..000000000 --- a/helm/alfresco-content-services/templates/secret-metadata-keystore.yaml +++ /dev/null @@ -1,10 +0,0 @@ -apiVersion: v1 -kind: Secret -metadata: - name: {{ template "content-services.shortname" . }}-metadata-keystore-secret - labels: - {{- include "repository.labels" . | nindent 4 }} -type: Opaque -data: - METADATA_KEYSTORE_PASSWORD: {{ .Values.metadataKeystore.keystorePassword | default .Values.metadataKeystore.defaultKeystorePassword | b64enc | quote }} - METADATA_KEY_PASSWORD: {{ .Values.metadataKeystore.keyPassword | default .Values.metadataKeystore.defaultKeyPassword | b64enc | quote }} diff --git a/helm/alfresco-content-services/templates/secret-repository-properties.yaml b/helm/alfresco-content-services/templates/secret-repository-properties.yaml index a61f73b02..ff433c912 100644 --- a/helm/alfresco-content-services/templates/secret-repository-properties.yaml +++ b/helm/alfresco-content-services/templates/secret-repository-properties.yaml @@ -4,7 +4,7 @@ kind: Secret metadata: name: {{ .Values.search.secretName }} labels: - {{- include "repository.labels" . | nindent 4 }} + {{- include "alfresco-content-services.labels" . | nindent 4 }} type: Opaque data: SOLR_SECRET: {{ include "tracking-shared-secret" . | b64enc | quote }} diff --git a/helm/alfresco-content-services/templates/secret-repository.yaml b/helm/alfresco-content-services/templates/secret-repository.yaml deleted file mode 100644 index 3a666eeab..000000000 --- a/helm/alfresco-content-services/templates/secret-repository.yaml +++ /dev/null @@ -1,11 +0,0 @@ -{{- if not .Values.repository.existingSecretName }} -apiVersion: v1 -kind: Secret -metadata: - name: {{ printf "%s-repository-secret" (include "content-services.shortname" .) }} - labels: - {{- include "repository.labels" . | nindent 4 }} -type: Opaque -data: - REPO_ADMIN_PASSWORD: {{ .Values.repository.adminPassword | default "209c6174da490caeb422f3fa5a7ae634" | b64enc | quote }} -{{- end }} diff --git a/helm/alfresco-content-services/templates/secret-s3.yaml b/helm/alfresco-content-services/templates/secret-s3.yaml deleted file mode 100755 index 65d21b2a9..000000000 --- a/helm/alfresco-content-services/templates/secret-s3.yaml +++ /dev/null @@ -1,22 +0,0 @@ -{{- if and .Values.s3connector.enabled (not .Values.s3connector.existingSecretName) }} -apiVersion: v1 -kind: Secret -metadata: - name: {{ template "content-services.shortname" . }}-s3secret - labels: - {{- include "repository.labels" . | nindent 4 }} -type: Opaque -data: - {{- if .Values.s3connector.secrets.accessKey }} - ACCESSKEY: {{ .Values.s3connector.secrets.accessKey | b64enc | quote }} - {{- end }} - {{- if .Values.s3connector.secrets.secretKey }} - SECRETKEY: {{ .Values.s3connector.secrets.secretKey | b64enc | quote }} - {{- end }} - {{- if .Values.s3connector.secrets.encryption }} - ENCRYPTION: {{ .Values.s3connector.secrets.encryption | b64enc | quote }} - {{- end }} - {{- if .Values.s3connector.secrets.awsKmsKeyId }} - KMSKEYID: {{ .Values.s3connector.secrets.awsKmsKeyId | b64enc | quote }} - {{- end }} -{{- end }} diff --git a/helm/alfresco-content-services/tests/secret-mail-password_test.yaml b/helm/alfresco-content-services/tests/secret-mail-password_test.yaml deleted file mode 100644 index 9570bbe11..000000000 --- a/helm/alfresco-content-services/tests/secret-mail-password_test.yaml +++ /dev/null @@ -1,41 +0,0 @@ ---- -suite: test mail password secret manifest -templates: - - secret-mail-password.yaml -tests: - - it: should have empty credentials as default - values: &testvalues - - values/test_values.yaml - asserts: - - hasDocuments: - count: 0 - - - it: should have credentials populated in the secret when host is set - values: *testvalues - set: - mail: - host: smtp.example.org - password: mymailpassword - asserts: - - equal: - path: data.MAIL_PASSWORD - value: bXltYWlscGFzc3dvcmQ= - - - it: should not have secret when existingSecretName is set - values: *testvalues - set: - mail: - host: smtp.example.org - existingSecretName: mySecret - asserts: - - hasDocuments: - count: 0 - - - it: should not have secret when no password is set - values: *testvalues - set: - mail: - host: smtp.example.org - asserts: - - hasDocuments: - count: 0 diff --git a/helm/alfresco-content-services/tests/secret-s3_test.yaml b/helm/alfresco-content-services/tests/secret-s3_test.yaml deleted file mode 100644 index 26ad653ca..000000000 --- a/helm/alfresco-content-services/tests/secret-s3_test.yaml +++ /dev/null @@ -1,45 +0,0 @@ ---- -suite: test s3 credentials secret manifest -templates: - - secret-s3.yaml -tests: - - it: should have no secret with default values - values: &testvalues - - values/test_values.yaml - asserts: - - hasDocuments: - count: 0 - - - it: should have credentials populated in the secret when enabled - values: *testvalues - set: - s3connector: - enabled: true - secrets: - accessKey: myAccessKey - secretKey: mySecretKey - encryption: myEncryption - awsKmsKeyId: myAwsKmsKeyId - asserts: - - equal: - path: data.ACCESSKEY - value: bXlBY2Nlc3NLZXk= - - equal: - path: data.SECRETKEY - value: bXlTZWNyZXRLZXk= - - equal: - path: data.ENCRYPTION - value: bXlFbmNyeXB0aW9u - - equal: - path: data.KMSKEYID - value: bXlBd3NLbXNLZXlJZA== - - - it: should not have a secret when global existingSecretName is set - values: *testvalues - set: - s3connector: - enabled: true - existingSecretName: mySecret - asserts: - - hasDocuments: - count: 0 From a992c9c4c6f61a77abda4e7687027742ab49a286 Mon Sep 17 00:00:00 2001 From: Alexandre Chapellon Date: Tue, 19 Sep 2023 23:59:08 +0200 Subject: [PATCH 10/10] temporarily duplicate broker url --- .../templates/secret-message-broker.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/helm/alfresco-content-services/templates/secret-message-broker.yaml b/helm/alfresco-content-services/templates/secret-message-broker.yaml index 823d98d79..527998b78 100644 --- a/helm/alfresco-content-services/templates/secret-message-broker.yaml +++ b/helm/alfresco-content-services/templates/secret-message-broker.yaml @@ -18,4 +18,6 @@ data: BROKER_PASSWORD: {{ .password | default "" | b64enc | quote }} {{- end }} {{- end }} + {{/* required until OPSEXP-2300 & OPSEXP-2293 */}} + BROKER_URL: {{ include "alfresco-content-services.mq.url" . | b64enc | quote }} {{- end }}