From 69bc787c5f5cdafdc8b968bf98fc65cdbadc2fe9 Mon Sep 17 00:00:00 2001 From: Alexandre Chapellon Date: Mon, 25 Sep 2023 16:50:48 +0200 Subject: [PATCH 1/4] make repository secrets optional --- charts/alfresco-repository/Chart.lock | 6 +++--- charts/alfresco-repository/Chart.yaml | 4 ++-- charts/alfresco-repository/README.md | 4 ++-- charts/alfresco-repository/templates/deployment.yaml | 4 ++-- charts/alfresco-repository/tests/deployment_test.yaml | 1 + 5 files changed, 10 insertions(+), 9 deletions(-) diff --git a/charts/alfresco-repository/Chart.lock b/charts/alfresco-repository/Chart.lock index e31c7727..4339c70c 100644 --- a/charts/alfresco-repository/Chart.lock +++ b/charts/alfresco-repository/Chart.lock @@ -1,9 +1,9 @@ dependencies: - name: alfresco-common repository: https://alfresco.github.io/alfresco-helm-charts/ - version: 2.1.0 + version: 3.0.0-alpha.1 - name: postgresql repository: oci://registry-1.docker.io/bitnamicharts version: 12.5.6 -digest: sha256:043a1323627d74eed9c3675ebe4c704df37d01011d07fb704fa24f1a81703c1b -generated: "2023-09-07T16:17:44.513368+02:00" +digest: sha256:22d0c45ef4db47622194e37559c7b4be5f45100a9439ac0c2fc7ef35f42261b0 +generated: "2023-09-25T16:46:46.082717+02:00" diff --git a/charts/alfresco-repository/Chart.yaml b/charts/alfresco-repository/Chart.yaml index 90bc5128..e01e94b9 100644 --- a/charts/alfresco-repository/Chart.yaml +++ b/charts/alfresco-repository/Chart.yaml @@ -2,11 +2,11 @@ apiVersion: v2 name: alfresco-repository description: Alfresco content repository Helm chart type: application -version: 0.1.0-alpha.8 +version: 0.1.0-alpha.9 appVersion: 23.1.0-A21 dependencies: - name: alfresco-common - version: 2.1.0 + version: 3.0.0-alpha.1 repository: https://alfresco.github.io/alfresco-helm-charts/ - name: postgresql version: 12.5.6 diff --git a/charts/alfresco-repository/README.md b/charts/alfresco-repository/README.md index 620670a8..41a374b8 100644 --- a/charts/alfresco-repository/README.md +++ b/charts/alfresco-repository/README.md @@ -1,6 +1,6 @@ # alfresco-repository -![Version: 0.1.0-alpha.8](https://img.shields.io/badge/Version-0.1.0--alpha.8-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 23.1.0-A21](https://img.shields.io/badge/AppVersion-23.1.0--A21-informational?style=flat-square) +![Version: 0.1.0-alpha.9](https://img.shields.io/badge/Version-0.1.0--alpha.9-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 23.1.0-A21](https://img.shields.io/badge/AppVersion-23.1.0--A21-informational?style=flat-square) Alfresco content repository Helm chart @@ -8,7 +8,7 @@ Alfresco content repository Helm chart | Repository | Name | Version | |------------|------|---------| -| https://alfresco.github.io/alfresco-helm-charts/ | alfresco-common | 2.1.0 | +| https://alfresco.github.io/alfresco-helm-charts/ | alfresco-common | 3.0.0-alpha.1 | | oci://registry-1.docker.io/bitnamicharts | postgresql | 12.5.6 | ## Configuring Alfresco subsystems diff --git a/charts/alfresco-repository/templates/deployment.yaml b/charts/alfresco-repository/templates/deployment.yaml index dc64a2fa..8dd53ce3 100644 --- a/charts/alfresco-repository/templates/deployment.yaml +++ b/charts/alfresco-repository/templates/deployment.yaml @@ -188,10 +188,10 @@ spec: {{- range .Values.configuration.repository.existingSecrets }} {{- if eq "acs-license" .purpose }} {{- $licitems := list (dict "key" .key "path" "license.lic") }} - {{- $licvol := dict "name" "acs-license" "secret" (dict "secretName" .name "defaultMode" 0400 "optional" true "items" $licitems ) }} + {{- $licvol := dict "name" "acs-license" "secret" (dict "secretName" .name "defaultMode" 0400 "optional" true "items" $licitems) }} {{- list $licvol | toYaml | nindent 8 }} {{- else if and (hasPrefix "subsystems:" (.purpose | default "")) (eq (splitList ":" (.purpose | default "") | len) 3) }} - {{- $subsysvol := dict "name" .name "secret" (dict "secretName" .name "defaultMode" 0400) }} + {{- $subsysvol := dict "name" .name "secret" (dict "secretName" .name "defaultMode" 0400 "optional" true) }} {{- list $subsysvol | toYaml | nindent 8 }} {{- end }} {{- end }} diff --git a/charts/alfresco-repository/tests/deployment_test.yaml b/charts/alfresco-repository/tests/deployment_test.yaml index d82c447d..2145971c 100644 --- a/charts/alfresco-repository/tests/deployment_test.yaml +++ b/charts/alfresco-repository/tests/deployment_test.yaml @@ -129,6 +129,7 @@ tests: secret: secretName: myAzureAD defaultMode: 0400 + optional: true template: deployment.yaml - contains: path: spec.template.spec.containers[0].volumeMounts From 2d3265cad21fd6ce8518b8d6deb4d677b68d0d70 Mon Sep 17 00:00:00 2001 From: Alexandre Chapellon Date: Mon, 25 Sep 2023 17:48:34 +0200 Subject: [PATCH 2/4] allow jdbc url starting with jdbc --- charts/alfresco-repository/Chart.yaml | 2 +- charts/alfresco-repository/README.md | 4 ++-- .../templates/_helpers-database.tpl | 2 +- .../templates/configmap-repository.yaml | 2 +- .../tests/configmap_test.yaml | 23 +++++-------------- charts/alfresco-repository/values.yaml | 2 +- 6 files changed, 12 insertions(+), 23 deletions(-) diff --git a/charts/alfresco-repository/Chart.yaml b/charts/alfresco-repository/Chart.yaml index e01e94b9..905d07d6 100644 --- a/charts/alfresco-repository/Chart.yaml +++ b/charts/alfresco-repository/Chart.yaml @@ -6,7 +6,7 @@ version: 0.1.0-alpha.9 appVersion: 23.1.0-A21 dependencies: - name: alfresco-common - version: 3.0.0-alpha.1 + version: 3.0.0-alpha.2 repository: https://alfresco.github.io/alfresco-helm-charts/ - name: postgresql version: 12.5.6 diff --git a/charts/alfresco-repository/README.md b/charts/alfresco-repository/README.md index 41a374b8..15e8b4ff 100644 --- a/charts/alfresco-repository/README.md +++ b/charts/alfresco-repository/README.md @@ -8,7 +8,7 @@ Alfresco content repository Helm chart | Repository | Name | Version | |------------|------|---------| -| https://alfresco.github.io/alfresco-helm-charts/ | alfresco-common | 3.0.0-alpha.1 | +| https://alfresco.github.io/alfresco-helm-charts/ | alfresco-common | 3.0.0-alpha.2 | | oci://registry-1.docker.io/bitnamicharts | postgresql | 12.5.6 | ## Configuring Alfresco subsystems @@ -105,7 +105,7 @@ environment: | configuration.db.existingSecret.keys.username | string | `"DATABASE_USERNAME"` | Key within the secret holding the database username | | configuration.db.existingSecret.name | string | `nil` | Name of a pre-existing secret containing database credentials | | configuration.db.password | string | `nil` | Password to authentication to the repository database | -| configuration.db.url | string | `nil` | JDBC url of the database WITHOUT the "jdbc:" prefix This is a mandatory parameter | +| configuration.db.url | string | `nil` | JDBC url of the database This is a mandatory parameter | | configuration.db.username | string | `nil` | Username to authentication to the repository database | | configuration.hz.port | int | `5701` | Hazelcast listener port Only change it if you use a custom image where the port has been changed from default | | configuration.messageBroker.existingConfigMap.keys.url | string | `"BROKER_URL"` | Key within the configmap holding the message broker URL. It MUST be a failover URL as per the spec below: https://activemq.apache.org/failover-transport-reference.html | diff --git a/charts/alfresco-repository/templates/_helpers-database.tpl b/charts/alfresco-repository/templates/_helpers-database.tpl index e33f865f..999b2a77 100644 --- a/charts/alfresco-repository/templates/_helpers-database.tpl +++ b/charts/alfresco-repository/templates/_helpers-database.tpl @@ -38,7 +38,7 @@ Usage: include "alfresco-repository.db.cm" (dict "url" "" "driver" "") */}} {{- define "alfresco-repository.db.cm" -}} - DATABASE_URL: {{ .url }} + DATABASE_URL: {{ hasPrefix "jdbc:" .url | ternary .url (print "jdbc:" .url) }} DATABASE_HOST: {{ template "alfresco-common.db.hostname" .url }} DATABASE_PORT: {{ include "alfresco-common.db.port" . | quote }} DATABASE_DRIVER: {{ template "alfresco-common.db.driver" . }} diff --git a/charts/alfresco-repository/templates/configmap-repository.yaml b/charts/alfresco-repository/templates/configmap-repository.yaml index af721032..d43fa024 100644 --- a/charts/alfresco-repository/templates/configmap-repository.yaml +++ b/charts/alfresco-repository/templates/configmap-repository.yaml @@ -10,7 +10,7 @@ data: CATALINA_OPTS: >- {{- with .Values.configuration }} -Ddeployment.method=HELM_CHART - -Ddb.url="jdbc:$DATABASE_URL" + -Ddb.url="$DATABASE_URL" -Ddb.username=${DATABASE_USERNAME} -Ddb.password=${DATABASE_PASSWORD} -Ddb.driver="$DATABASE_DRIVER" diff --git a/charts/alfresco-repository/tests/configmap_test.yaml b/charts/alfresco-repository/tests/configmap_test.yaml index ead3305e..4c6bacb2 100644 --- a/charts/alfresco-repository/tests/configmap_test.yaml +++ b/charts/alfresco-repository/tests/configmap_test.yaml @@ -54,7 +54,7 @@ tests: asserts: - equal: path: data.DATABASE_URL - value: mysql://sandy:secret@myhost1:1111 + value: jdbc:mysql://sandy:secret@myhost1:1111 - equal: path: data.DATABASE_HOST value: myhost1 @@ -70,11 +70,11 @@ tests: set: configuration: db: - url: postgresql://pghost/alfdb + url: jdbc:postgresql://pghost/alfdb asserts: - equal: path: data.DATABASE_URL - value: postgresql://pghost/alfdb + value: jdbc:postgresql://pghost/alfdb - equal: path: data.DATABASE_HOST value: pghost @@ -94,7 +94,7 @@ tests: asserts: - equal: path: data.DATABASE_URL - value: sqlserver://sqlserverhost;databaseName=alfdb;lockTimeout=1000; + value: jdbc:sqlserver://sqlserverhost;databaseName=alfdb;lockTimeout=1000; - equal: path: data.DATABASE_HOST value: sqlserverhost @@ -110,11 +110,11 @@ tests: set: configuration: db: - url: oracle:thin:@tcp://mydbhost:1521/mydbservice + url: jdbc:oracle:thin:@tcp://mydbhost:1521/mydbservice asserts: - equal: path: data.DATABASE_URL - value: oracle:thin:@tcp://mydbhost:1521/mydbservice + value: jdbc:oracle:thin:@tcp://mydbhost:1521/mydbservice - equal: path: data.DATABASE_HOST value: mydbhost @@ -125,17 +125,6 @@ tests: path: data.DATABASE_DRIVER value: oracle.jdbc.OracleDriver - - it: should fail without proper db URL - template: configmap-repository.yaml - set: - configuration: - db: - url: jdbc:mysql://myhost/db - asserts: - - failedTemplate: - errorMessage: >- - database URL MUST be provided WITHOUT the 'jdbc' prefix. - - it: should render ActiveMQ config as needed template: configmap-mq.yaml asserts: diff --git a/charts/alfresco-repository/values.yaml b/charts/alfresco-repository/values.yaml index 4b81df48..40c14315 100644 --- a/charts/alfresco-repository/values.yaml +++ b/charts/alfresco-repository/values.yaml @@ -34,7 +34,7 @@ configuration: key: license.lic purpose: acs-license db: - # -- JDBC url of the database WITHOUT the "jdbc:" prefix + # -- JDBC url of the database # This is a mandatory parameter url: null # -- JDBC driver class of the driver if none is provided the it is guessed From 311a07abd455e2032c48664043fc8cf887232097 Mon Sep 17 00:00:00 2001 From: alxgomz Date: Mon, 25 Sep 2023 15:51:19 +0000 Subject: [PATCH 3/4] Apply automatic changes --- charts/alfresco-repository/Chart.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/charts/alfresco-repository/Chart.lock b/charts/alfresco-repository/Chart.lock index 4339c70c..99a8846a 100644 --- a/charts/alfresco-repository/Chart.lock +++ b/charts/alfresco-repository/Chart.lock @@ -1,9 +1,9 @@ dependencies: - name: alfresco-common repository: https://alfresco.github.io/alfresco-helm-charts/ - version: 3.0.0-alpha.1 + version: 3.0.0-alpha.2 - name: postgresql repository: oci://registry-1.docker.io/bitnamicharts version: 12.5.6 -digest: sha256:22d0c45ef4db47622194e37559c7b4be5f45100a9439ac0c2fc7ef35f42261b0 -generated: "2023-09-25T16:46:46.082717+02:00" +digest: sha256:8b29bc4958ca18fce2e9b0fe2d8d21b4628cb3e1c13f90226378fe6ac3fbd9ff +generated: "2023-09-25T15:51:04.023194318Z" From 02578a119ac956b13d1cbc245d5e84da9f7ef8dc Mon Sep 17 00:00:00 2001 From: Alexandre Chapellon Date: Mon, 25 Sep 2023 19:27:46 +0200 Subject: [PATCH 4/4] revert optional secret for subsystems --- charts/alfresco-repository/templates/deployment.yaml | 2 +- charts/alfresco-repository/tests/deployment_test.yaml | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/charts/alfresco-repository/templates/deployment.yaml b/charts/alfresco-repository/templates/deployment.yaml index 8dd53ce3..49ca4f62 100644 --- a/charts/alfresco-repository/templates/deployment.yaml +++ b/charts/alfresco-repository/templates/deployment.yaml @@ -191,7 +191,7 @@ spec: {{- $licvol := dict "name" "acs-license" "secret" (dict "secretName" .name "defaultMode" 0400 "optional" true "items" $licitems) }} {{- list $licvol | toYaml | nindent 8 }} {{- else if and (hasPrefix "subsystems:" (.purpose | default "")) (eq (splitList ":" (.purpose | default "") | len) 3) }} - {{- $subsysvol := dict "name" .name "secret" (dict "secretName" .name "defaultMode" 0400 "optional" true) }} + {{- $subsysvol := dict "name" .name "secret" (dict "secretName" .name "defaultMode" 0400) }} {{- list $subsysvol | toYaml | nindent 8 }} {{- end }} {{- end }} diff --git a/charts/alfresco-repository/tests/deployment_test.yaml b/charts/alfresco-repository/tests/deployment_test.yaml index 2145971c..d82c447d 100644 --- a/charts/alfresco-repository/tests/deployment_test.yaml +++ b/charts/alfresco-repository/tests/deployment_test.yaml @@ -129,7 +129,6 @@ tests: secret: secretName: myAzureAD defaultMode: 0400 - optional: true template: deployment.yaml - contains: path: spec.template.spec.containers[0].volumeMounts