From f6eba7a5d4691694980211babd05c8fe3ccbf109 Mon Sep 17 00:00:00 2001 From: Alex Chapellon Date: Fri, 27 Oct 2023 17:17:22 +0200 Subject: [PATCH 1/7] OPSEXP-2297: change alfresco-common.db.port named template param to a single str (#138) --- charts/alfresco-common/Chart.yaml | 2 +- charts/alfresco-common/README.md | 2 +- charts/alfresco-common/templates/_helpers-jdbc.tpl | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/charts/alfresco-common/Chart.yaml b/charts/alfresco-common/Chart.yaml index c27c2947..ef93ce14 100644 --- a/charts/alfresco-common/Chart.yaml +++ b/charts/alfresco-common/Chart.yaml @@ -5,7 +5,7 @@ description: | A helper subchart to avoid duplication in alfresco charts and set common external dependencies type: library -version: 3.0.0-alpha.3 +version: 3.0.0-alpha.4 dependencies: - name: common repository: oci://registry-1.docker.io/bitnamicharts diff --git a/charts/alfresco-common/README.md b/charts/alfresco-common/README.md index 47a3604b..5a400491 100644 --- a/charts/alfresco-common/README.md +++ b/charts/alfresco-common/README.md @@ -1,6 +1,6 @@ # alfresco-common -![Version: 3.0.0-alpha.3](https://img.shields.io/badge/Version-3.0.0--alpha.3-informational?style=flat-square) ![Type: library](https://img.shields.io/badge/Type-library-informational?style=flat-square) +![Version: 3.0.0-alpha.4](https://img.shields.io/badge/Version-3.0.0--alpha.4-informational?style=flat-square) ![Type: library](https://img.shields.io/badge/Type-library-informational?style=flat-square) A helper subchart to avoid duplication in alfresco charts and set common external dependencies diff --git a/charts/alfresco-common/templates/_helpers-jdbc.tpl b/charts/alfresco-common/templates/_helpers-jdbc.tpl index 625d8862..73ce9aaf 100644 --- a/charts/alfresco-common/templates/_helpers-jdbc.tpl +++ b/charts/alfresco-common/templates/_helpers-jdbc.tpl @@ -102,15 +102,15 @@ Usage: include "alfresco-common.db.hostname" "URL" {{/* Provide database port from JDBC URL -Usage: include "alfresco-common.db.port" (dict "url" "someurl") +Usage: include "alfresco-common.db.port" "URL" */}} {{- define "alfresco-common.db.port" -}} -{{- $socket := (index (include "alfresco-common.jdbc.parser" .url | fromJson) "jdbc" "host") }} +{{- $socket := (index (include "alfresco-common.jdbc.parser" . | fromJson) "jdbc" "host") }} {{- if gt ($socket | splitList ":" | len) 1 }} {{- $socket | splitList ":" | last }} {{- else }} - {{- template "alfresco-common.db.default.port" (index (include "alfresco-common.jdbc.parser" .url | fromJson) "jdbc" "scheme") }} + {{- template "alfresco-common.db.default.port" (index (include "alfresco-common.jdbc.parser" . | fromJson) "jdbc" "scheme") }} {{- end }} {{- end -}} From c7e32d9db7a6de5c0549e41d97c5a60180569841 Mon Sep 17 00:00:00 2001 From: Alex Chapellon Date: Fri, 27 Oct 2023 18:25:43 +0200 Subject: [PATCH 2/7] OPSEXP-2297: cleanup unnecessary repo vars (#139) Co-authored-by: alxgomz --- charts/alfresco-repository/Chart.lock | 6 +-- charts/alfresco-repository/Chart.yaml | 4 +- charts/alfresco-repository/README.md | 6 +-- .../templates/_helpers-database.tpl | 12 ----- .../templates/configmap-repository.yaml | 2 +- .../templates/deployment.yaml | 17 +++--- .../tests/configmap_test.yaml | 24 --------- .../tests/deployment_test.yaml | 53 ++++++++++++++++++- charts/alfresco-repository/values.yaml | 8 --- 9 files changed, 69 insertions(+), 63 deletions(-) diff --git a/charts/alfresco-repository/Chart.lock b/charts/alfresco-repository/Chart.lock index fb98242b..3a1e501b 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.3 + version: 3.0.0-alpha.4 - name: postgresql repository: oci://registry-1.docker.io/bitnamicharts version: 12.5.6 -digest: sha256:fc5f240540fd10560dca1e88b13601b18128e2fbf0ed0b52ab9294ad58dff037 -generated: "2023-10-18T14:43:10.28712+02:00" +digest: sha256:569e88f1d311e341437a62bae88d6bca83b986d8f40cb9bbafd4f33aa4e9ed8f +generated: "2023-10-27T17:28:14.899057+02:00" diff --git a/charts/alfresco-repository/Chart.yaml b/charts/alfresco-repository/Chart.yaml index b941fb19..0fc5393f 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.19 +version: 0.1.0-alpha.20 appVersion: 23.1.0-A21 dependencies: - name: alfresco-common - version: 3.0.0-alpha.3 + version: 3.0.0-alpha.4 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 dd00a424..d9db5253 100644 --- a/charts/alfresco-repository/README.md +++ b/charts/alfresco-repository/README.md @@ -1,6 +1,6 @@ # alfresco-repository -![Version: 0.1.0-alpha.19](https://img.shields.io/badge/Version-0.1.0--alpha.19-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.20](https://img.shields.io/badge/Version-0.1.0--alpha.20-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 | 3.0.0-alpha.3 | +| https://alfresco.github.io/alfresco-helm-charts/ | alfresco-common | 3.0.0-alpha.4 | | oci://registry-1.docker.io/bitnamicharts | postgresql | 12.5.6 | ## Values @@ -20,8 +20,6 @@ Alfresco content repository Helm chart | command | list | `[]` | | | configuration.db.driver | string | `nil` | JDBC driver class of the driver if none is provided the it is guessed from the URL provided | | configuration.db.existingConfigMap.keys.driver | string | `"DATABASE_DRIVER"` | configmap key where to find the JDBC driver class to use. The configmap may leverage the alfresco-repository.db.cm named template to auto-generate it from the sole url parameter. | -| configuration.db.existingConfigMap.keys.host | string | `"DATABASE_HOST"` | configmap key where to find the hostname part of the database URL. The configmap may leverage the alfresco-repository.db.cm named template to auto-generate it from the sole url parameter. | -| configuration.db.existingConfigMap.keys.port | string | `"DATABASE_PORT"` | configmap key where to find the port part of the database URL. The configmap may leverage the alfresco-repository.db.cm named template to auto-generate it from the sole url parameter. | | configuration.db.existingConfigMap.keys.url | string | `"DATABASE_URL"` | configmap key where to find the URL of the database | | configuration.db.existingConfigMap.name | string | `nil` | | | configuration.db.existingSecret | object | `{"keys":{"password":"DATABASE_PASSWORD","username":"DATABASE_USERNAME"},"name":null}` | Existing secret and their keys where to find the database username & password. | diff --git a/charts/alfresco-repository/templates/_helpers-database.tpl b/charts/alfresco-repository/templates/_helpers-database.tpl index 999b2a77..9d808c5c 100644 --- a/charts/alfresco-repository/templates/_helpers-database.tpl +++ b/charts/alfresco-repository/templates/_helpers-database.tpl @@ -13,16 +13,6 @@ Usage: include "alfresco-repository.db.env" $ configMapKeyRef: name: {{ $dbcm }} key: {{ .existingConfigMap.keys.url }} -- name: DATABASE_HOST - valueFrom: - configMapKeyRef: - name: {{ $dbcm }} - key: {{ .existingConfigMap.keys.host }} -- name: DATABASE_PORT - valueFrom: - configMapKeyRef: - name: {{ $dbcm }} - key: {{ .existingConfigMap.keys.port }} - name: DATABASE_DRIVER valueFrom: configMapKeyRef: @@ -39,7 +29,5 @@ Usage: include "alfresco-repository.db.cm" (dict "url" "" "driver" "") */}} {{- define "alfresco-repository.db.cm" -}} 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" . }} {{- end -}} diff --git a/charts/alfresco-repository/templates/configmap-repository.yaml b/charts/alfresco-repository/templates/configmap-repository.yaml index 2394cca7..f1e58ef8 100644 --- a/charts/alfresco-repository/templates/configmap-repository.yaml +++ b/charts/alfresco-repository/templates/configmap-repository.yaml @@ -16,7 +16,7 @@ data: -Ddb.url="$DATABASE_URL" -Ddb.username=${DATABASE_USERNAME} -Ddb.password=${DATABASE_PASSWORD} - -Ddb.driver="$DATABASE_DRIVER" + -Ddb.driver="{{ printf "${DATABASE_DRIVER:-%s}" (include "alfresco-common.db.driver" .db) }}" -Dmessaging.broker.url="$BROKER_URL" -Dmessaging.broker.username="$BROKER_USERNAME" -Dmessaging.broker.password="$BROKER_PASSWORD" diff --git a/charts/alfresco-repository/templates/deployment.yaml b/charts/alfresco-repository/templates/deployment.yaml index b7994714..4bd274f8 100644 --- a/charts/alfresco-repository/templates/deployment.yaml +++ b/charts/alfresco-repository/templates/deployment.yaml @@ -21,15 +21,15 @@ spec: {{- include "alfresco-repository.selectorLabels" . | nindent 8 }} spec: serviceAccountName: {{ include "alfresco-repository.serviceAccountName" . }} - {{- include "component-pod-security-context" .Values | indent 4 }} + {{- include "alfresco-common.component-pod-security-context" .Values | indent 4 }} nodeSelector: {{- toYaml .Values.nodeSelector | nindent 8 }} - {{- include "alfresco-content-services.imagePullSecrets" . | indent 6 }} + {{- include "alfresco-common.imagePullSecrets" . | indent 6 }} initContainers: - name: wait-db-ready image: busybox:1.35 imagePullPolicy: IfNotPresent - {{- include "component-security-context" dict | indent 8 }} + {{- include "alfresco-common.component-security-context" dict | indent 8 }} resources: limits: cpu: "0.25" @@ -40,13 +40,16 @@ spec: - sh - -c - | - until nc -w1 $(DATABASE_HOST):$(DATABASE_PORT) - do echo "waiting for database on $(DATABASE_HOST):$(DATABASE_PORT)" + {{- with .Values.configuration.db }} + {{- $dbsocket := printf "%s:%s" (include "alfresco-common.db.hostname" .url) (include "alfresco-common.db.port" .url) }} + until nc -w1 {{ $dbsocket }} + do echo 'waiting for {{ template "alfresco-common.db.rdbms" .url }} database on {{ $dbsocket }}' sleep 2 done + {{- end }} containers: - name: {{ .Chart.Name }} - {{- include "component-security-context" .Values | indent 8 }} + {{- include "alfresco-common.component-security-context" .Values | indent 8 }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.image.pullPolicy }} {{- $dbsecretCtx := dict }} @@ -189,7 +192,7 @@ spec: {{ tpl (toYaml (list .)) $ | nindent 8 }} {{- end }} volumes: - {{- include "data_volume" .Values | nindent 8 }} + {{- include "alfresco-common.data_volume" .Values | nindent 8 }} {{- if .Values.configuration.repository.existingConfigMap }} - name: global-properties configMap: diff --git a/charts/alfresco-repository/tests/configmap_test.yaml b/charts/alfresco-repository/tests/configmap_test.yaml index 38e8a77f..d29e23c7 100644 --- a/charts/alfresco-repository/tests/configmap_test.yaml +++ b/charts/alfresco-repository/tests/configmap_test.yaml @@ -59,12 +59,6 @@ tests: - equal: path: data.DATABASE_URL value: jdbc:mysql://sandy:secret@myhost1:1111 - - equal: - path: data.DATABASE_HOST - value: myhost1 - - equal: - path: data.DATABASE_PORT - value: "1111" - equal: path: data.DATABASE_DRIVER value: com.mysql.jdbc.Driver @@ -79,12 +73,6 @@ tests: - equal: path: data.DATABASE_URL value: jdbc:postgresql://pghost/alfdb - - equal: - path: data.DATABASE_HOST - value: pghost - - equal: - path: data.DATABASE_PORT - value: "5432" - equal: path: data.DATABASE_DRIVER value: org.postgresql.Driver @@ -99,12 +87,6 @@ tests: - equal: path: data.DATABASE_URL value: jdbc:sqlserver://sqlserverhost;databaseName=alfdb;lockTimeout=1000; - - equal: - path: data.DATABASE_HOST - value: sqlserverhost - - equal: - path: data.DATABASE_PORT - value: "1434" - equal: path: data.DATABASE_DRIVER value: com.microsoft.sqlserver.jdbc.SQLServerDriver @@ -119,12 +101,6 @@ tests: - equal: path: data.DATABASE_URL value: jdbc:oracle:thin:@tcp://mydbhost:1521/mydbservice - - equal: - path: data.DATABASE_HOST - value: mydbhost - - equal: - path: data.DATABASE_PORT - value: "1521" - equal: path: data.DATABASE_DRIVER value: oracle.jdbc.OracleDriver diff --git a/charts/alfresco-repository/tests/deployment_test.yaml b/charts/alfresco-repository/tests/deployment_test.yaml index 94c373bb..3be76f8f 100644 --- a/charts/alfresco-repository/tests/deployment_test.yaml +++ b/charts/alfresco-repository/tests/deployment_test.yaml @@ -69,8 +69,8 @@ tests: - contains: path: spec.template.spec.initContainers[0].command content: | - until nc -w1 $(DATABASE_HOST):$(DATABASE_PORT) - do echo "waiting for database on $(DATABASE_HOST):$(DATABASE_PORT)" + until nc -w1 myhost1:1111 + do echo 'waiting for mysql database on myhost1:1111' sleep 2 done template: deployment.yaml @@ -193,3 +193,52 @@ tests: configMapKeyRef: name: mycm key: DBURL + + + - it: should render wait-db-ready initcontainer with PostgreSQL server details + values: *test_values + set: + configuration: + db: + url: jdbc:postgresql://pghost/alfdb + asserts: + - contains: + path: spec.template.spec.initContainers[0].command + content: | + until nc -w1 pghost:5432 + do echo 'waiting for postgresql database on pghost:5432' + sleep 2 + done + template: deployment.yaml + + - it: should render wait-db-ready initcontainer with Oracle server details + values: *test_values + set: + configuration: + db: + url: oracle:thin:@tcp://mydbhost:1521/mydbservice + asserts: + - contains: + path: spec.template.spec.initContainers[0].command + content: | + until nc -w1 mydbhost:1521 + do echo 'waiting for oracle database on mydbhost:1521' + sleep 2 + done + template: deployment.yaml + + - it: should render wait-db-ready initcontainer with MQ SQL server details + values: *test_values + set: + configuration: + db: + url: sqlserver://sqlserverhost;databaseName=alfdb;lockTimeout=1000; + asserts: + - contains: + path: spec.template.spec.initContainers[0].command + content: | + until nc -w1 sqlserverhost:1434 + do echo 'waiting for sqlserver database on sqlserverhost:1434' + sleep 2 + done + template: deployment.yaml diff --git a/charts/alfresco-repository/values.yaml b/charts/alfresco-repository/values.yaml index d5a23f3a..350fc026 100644 --- a/charts/alfresco-repository/values.yaml +++ b/charts/alfresco-repository/values.yaml @@ -60,14 +60,6 @@ configuration: keys: # -- configmap key where to find the URL of the database url: DATABASE_URL - # -- configmap key where to find the hostname part of the database URL. - # The configmap may leverage the alfresco-repository.db.cm named - # template to auto-generate it from the sole url parameter. - host: DATABASE_HOST - # -- configmap key where to find the port part of the database URL. - # The configmap may leverage the alfresco-repository.db.cm named - # template to auto-generate it from the sole url parameter. - port: DATABASE_PORT # -- configmap key where to find the JDBC driver class to use. # The configmap may leverage the alfresco-repository.db.cm named # template to auto-generate it from the sole url parameter. From 858f71fb1066e19b7fdf7daeb854827097ffb0b5 Mon Sep 17 00:00:00 2001 From: Alex Chapellon Date: Tue, 31 Oct 2023 19:01:44 +0100 Subject: [PATCH 3/7] OPSEXP-2297: fixup & revert optional driverclass (#140) Co-authored-by: alxgomz --- charts/alfresco-repository/Chart.yaml | 2 +- charts/alfresco-repository/README.md | 2 +- .../templates/configmap-repository.yaml | 2 +- .../templates/deployment.yaml | 17 ++-- .../templates/secret-database.yaml | 2 +- .../tests/deployment_test.yaml | 80 +++++-------------- .../tests/secrets_test.yaml | 2 +- 7 files changed, 37 insertions(+), 70 deletions(-) diff --git a/charts/alfresco-repository/Chart.yaml b/charts/alfresco-repository/Chart.yaml index 0fc5393f..e33c19a5 100644 --- a/charts/alfresco-repository/Chart.yaml +++ b/charts/alfresco-repository/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: alfresco-repository description: Alfresco content repository Helm chart type: application -version: 0.1.0-alpha.20 +version: 0.1.0-alpha.21 appVersion: 23.1.0-A21 dependencies: - name: alfresco-common diff --git a/charts/alfresco-repository/README.md b/charts/alfresco-repository/README.md index d9db5253..0e941970 100644 --- a/charts/alfresco-repository/README.md +++ b/charts/alfresco-repository/README.md @@ -1,6 +1,6 @@ # alfresco-repository -![Version: 0.1.0-alpha.20](https://img.shields.io/badge/Version-0.1.0--alpha.20-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.21](https://img.shields.io/badge/Version-0.1.0--alpha.21-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 diff --git a/charts/alfresco-repository/templates/configmap-repository.yaml b/charts/alfresco-repository/templates/configmap-repository.yaml index f1e58ef8..0a829980 100644 --- a/charts/alfresco-repository/templates/configmap-repository.yaml +++ b/charts/alfresco-repository/templates/configmap-repository.yaml @@ -16,7 +16,7 @@ data: -Ddb.url="$DATABASE_URL" -Ddb.username=${DATABASE_USERNAME} -Ddb.password=${DATABASE_PASSWORD} - -Ddb.driver="{{ printf "${DATABASE_DRIVER:-%s}" (include "alfresco-common.db.driver" .db) }}" + -Ddb.driver="${DATABASE_DRIVER}" -Dmessaging.broker.url="$BROKER_URL" -Dmessaging.broker.username="$BROKER_USERNAME" -Dmessaging.broker.password="$BROKER_PASSWORD" diff --git a/charts/alfresco-repository/templates/deployment.yaml b/charts/alfresco-repository/templates/deployment.yaml index 4bd274f8..fbfae747 100644 --- a/charts/alfresco-repository/templates/deployment.yaml +++ b/charts/alfresco-repository/templates/deployment.yaml @@ -40,13 +40,16 @@ spec: - sh - -c - | - {{- with .Values.configuration.db }} - {{- $dbsocket := printf "%s:%s" (include "alfresco-common.db.hostname" .url) (include "alfresco-common.db.port" .url) }} - until nc -w1 {{ $dbsocket }} - do echo 'waiting for {{ template "alfresco-common.db.rdbms" .url }} database on {{ $dbsocket }}' - sleep 2 - done - {{- end }} + NCTARGET=$(echo DATABASE_URL | awk -F ';|/' '{print $3}') + if [[ "$NCTARGET" == *":"* ]]; then + until nc -vw1 $NCTARGET; do + sleep 2 + done + else echo "No port in jdbc URL $DATABASE_URL. Can't guess it so skipping db status check" + fi + {{- range .Values.extraInitContainers }} + {{- list . | toYaml | nindent 8 }} + {{- end }} containers: - name: {{ .Chart.Name }} {{- include "alfresco-common.component-security-context" .Values | indent 8 }} diff --git a/charts/alfresco-repository/templates/secret-database.yaml b/charts/alfresco-repository/templates/secret-database.yaml index fd31e4d3..eccca1ba 100644 --- a/charts/alfresco-repository/templates/secret-database.yaml +++ b/charts/alfresco-repository/templates/secret-database.yaml @@ -8,7 +8,7 @@ metadata: labels: {{- include "alfresco-repository.labels" . | nindent 4 }} type: Opaque -{{- $reqmsg := "Either provide database credentiasl as values, or provide a secret that contains them." }} +{{- $reqmsg := "Either provide database credentials as values, or provide a secret that contains them." }} data: DATABASE_USERNAME: {{ required $reqmsg .Values.configuration.db.username | b64enc | quote }} DATABASE_PASSWORD: {{ required $reqmsg .Values.configuration.db.password | b64enc | quote }} diff --git a/charts/alfresco-repository/tests/deployment_test.yaml b/charts/alfresco-repository/tests/deployment_test.yaml index 3be76f8f..be83f6a8 100644 --- a/charts/alfresco-repository/tests/deployment_test.yaml +++ b/charts/alfresco-repository/tests/deployment_test.yaml @@ -60,21 +60,6 @@ tests: memory: "8Gi" template: deployment.yaml - - it: should have wait-db-ready initcontainer - asserts: - - equal: - path: spec.template.spec.initContainers[0].name - value: wait-db-ready - template: deployment.yaml - - contains: - path: spec.template.spec.initContainers[0].command - content: | - until nc -w1 myhost1:1111 - do echo 'waiting for mysql database on myhost1:1111' - sleep 2 - done - template: deployment.yaml - - it: should have custom extra volumes when defined set: extraVolumes: @@ -137,6 +122,7 @@ tests: mountPath: /usr/local/tomcat/shared/classes/alfresco/extension/subsystems/Authentication/ldap-ad/myAzureAD readOnly: true template: deployment.yaml + - it: should not have any license volume but vars instead set: configuration: @@ -175,7 +161,7 @@ tests: name: RELEASE-NAME-alfresco-database key: DATABASE_URL - - it: should render configured DATABASE URL + - it: should render deployment using provided database cm set: configuration: db: @@ -193,52 +179,30 @@ tests: configMapKeyRef: name: mycm key: DBURL - - - - it: should render wait-db-ready initcontainer with PostgreSQL server details - values: *test_values - set: - configuration: - db: - url: jdbc:postgresql://pghost/alfdb - asserts: - contains: - path: spec.template.spec.initContainers[0].command - content: | - until nc -w1 pghost:5432 - do echo 'waiting for postgresql database on pghost:5432' - sleep 2 - done - template: deployment.yaml + path: spec.template.spec.containers[0].env + content: + name: DATABASE_DRIVER + valueFrom: + configMapKeyRef: + name: mycm + key: DBDRIVER - - it: should render wait-db-ready initcontainer with Oracle server details + - it: should deploy with extra containers values: *test_values set: - configuration: - db: - url: oracle:thin:@tcp://mydbhost:1521/mydbservice + extraInitContainers: + - name: init1 + image: init:latest + extraSideContainers: + - name: sidecar1 + image: sidecar:latest asserts: - - contains: - path: spec.template.spec.initContainers[0].command - content: | - until nc -w1 mydbhost:1521 - do echo 'waiting for oracle database on mydbhost:1521' - sleep 2 - done + - lengthEqual: + path: spec.template.spec.initContainers + count: 2 template: deployment.yaml - - - it: should render wait-db-ready initcontainer with MQ SQL server details - values: *test_values - set: - configuration: - db: - url: sqlserver://sqlserverhost;databaseName=alfdb;lockTimeout=1000; - asserts: - - contains: - path: spec.template.spec.initContainers[0].command - content: | - until nc -w1 sqlserverhost:1434 - do echo 'waiting for sqlserver database on sqlserverhost:1434' - sleep 2 - done + - lengthEqual: + path: spec.template.spec.containers + count: 2 template: deployment.yaml diff --git a/charts/alfresco-repository/tests/secrets_test.yaml b/charts/alfresco-repository/tests/secrets_test.yaml index 8e9ab5be..3402b06d 100644 --- a/charts/alfresco-repository/tests/secrets_test.yaml +++ b/charts/alfresco-repository/tests/secrets_test.yaml @@ -9,7 +9,7 @@ tests: asserts: - failedTemplate: errorMessage: >- - Either provide database credentiasl as values, or provide a secret that contains them. + Either provide database credentials as values, or provide a secret that contains them. - it: should not render template set: configuration: From 151804099fb0db246547eb91a0b6fec14979be14 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 6 Nov 2023 10:24:29 +0100 Subject: [PATCH 4/7] Bump Alfresco/alfresco-build-tools from 3.1.0 to 3.6.0 (#141) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/pre-commit.yaml | 4 ++-- .github/workflows/updatecli.yaml | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/pre-commit.yaml b/.github/workflows/pre-commit.yaml index 42d7d629..c19c7838 100644 --- a/.github/workflows/pre-commit.yaml +++ b/.github/workflows/pre-commit.yaml @@ -16,10 +16,10 @@ jobs: permissions: contents: write steps: - - uses: Alfresco/alfresco-build-tools/.github/actions/setup-helm-docs@v3.1.0 + - uses: Alfresco/alfresco-build-tools/.github/actions/setup-helm-docs@v3.6.0 - name: Install kubeconform helm plugin run: | helm plugin install https://github.com/jtyr/kubeconform-helm --version v0.1.12 - - uses: Alfresco/alfresco-build-tools/.github/actions/pre-commit@v3.1.0 + - uses: Alfresco/alfresco-build-tools/.github/actions/pre-commit@v3.6.0 with: auto-commit: "true" diff --git a/.github/workflows/updatecli.yaml b/.github/workflows/updatecli.yaml index e539f912..f1bf708b 100644 --- a/.github/workflows/updatecli.yaml +++ b/.github/workflows/updatecli.yaml @@ -24,7 +24,7 @@ jobs: token: ${{ secrets.BOT_GITHUB_TOKEN }} - uses: >- - Alfresco/alfresco-build-tools/.github/actions/get-branch-name@v3.1.0 + Alfresco/alfresco-build-tools/.github/actions/get-branch-name@v3.6.0 - name: Login to quay.io uses: docker/login-action@v3 @@ -42,9 +42,9 @@ jobs: env: GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} - - uses: Alfresco/alfresco-build-tools/.github/actions/setup-helm-docs@v3.1.0 + - uses: Alfresco/alfresco-build-tools/.github/actions/setup-helm-docs@v3.6.0 - name: Regenerate helm docs if necessary - uses: Alfresco/alfresco-build-tools/.github/actions/pre-commit@v3.1.0 + uses: Alfresco/alfresco-build-tools/.github/actions/pre-commit@v3.6.0 with: pre-commit-args: helm-docs || true skip_checkout: "true" @@ -70,7 +70,7 @@ jobs: token: ${{ secrets.BOT_GITHUB_TOKEN }} - uses: >- - Alfresco/alfresco-build-tools/.github/actions/get-branch-name@v3.1.0 + Alfresco/alfresco-build-tools/.github/actions/get-branch-name@v3.6.0 - name: Login to quay.io uses: docker/login-action@v3 @@ -102,9 +102,9 @@ jobs: QUAY_PASSWORD: ${{ secrets.QUAY_PASSWORD }} UPDATECLI_GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN }} - - uses: Alfresco/alfresco-build-tools/.github/actions/setup-helm-docs@v3.1.0 + - uses: Alfresco/alfresco-build-tools/.github/actions/setup-helm-docs@v3.6.0 - name: Regenerate helm docs if necessary - uses: Alfresco/alfresco-build-tools/.github/actions/pre-commit@v3.1.0 + uses: Alfresco/alfresco-build-tools/.github/actions/pre-commit@v3.6.0 with: pre-commit-args: helm-docs || true skip_checkout: "true" From b0ab0b9916d64d26b27bed146c8764edd85cfde3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 6 Nov 2023 10:25:08 +0100 Subject: [PATCH 5/7] Bump stefanzweifel/git-auto-commit-action from 4.16.0 to 5.0.0 (#127) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/updatecli.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/updatecli.yaml b/.github/workflows/updatecli.yaml index f1bf708b..dc61088e 100644 --- a/.github/workflows/updatecli.yaml +++ b/.github/workflows/updatecli.yaml @@ -50,7 +50,7 @@ jobs: skip_checkout: "true" - name: Git Auto Commit - uses: stefanzweifel/git-auto-commit-action@v4.16.0 + uses: stefanzweifel/git-auto-commit-action@v5.0.0 with: commit_message: | 🛠 Updatecli pipeline bump @@ -110,7 +110,7 @@ jobs: skip_checkout: "true" - name: Git Auto Commit - uses: stefanzweifel/git-auto-commit-action@v4.16.0 + uses: stefanzweifel/git-auto-commit-action@v5.0.0 with: commit_message: | 🛠 Updatecli pipeline acs bump From 75c7431adb2032e6354d5911fc81e73e6b5943d6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 6 Nov 2023 11:03:28 +0100 Subject: [PATCH 6/7] Bump helm/chart-testing-action from 2.4.0 to 2.6.1 (#143) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/lint-test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint-test.yaml b/.github/workflows/lint-test.yaml index 142a5f10..3d876226 100644 --- a/.github/workflows/lint-test.yaml +++ b/.github/workflows/lint-test.yaml @@ -37,7 +37,7 @@ jobs: helm plugin install https://github.com/helm-unittest/helm-unittest --version $HELM_UNITTEST_VERSION - name: Set up chart-testing - uses: helm/chart-testing-action@v2.4.0 + uses: helm/chart-testing-action@v2.6.1 with: version: v3.8.0 From bde59901c8abd86763ec44222215cca353aec9ff Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 6 Nov 2023 11:18:28 +0100 Subject: [PATCH 7/7] Bump helm/chart-releaser-action from 1.5.0 to 1.6.0 (#142) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/release.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 05061d32..8c541f75 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -54,7 +54,7 @@ jobs: helm repo add elastic https://helm.elastic.co - name: Run chart-releaser - uses: helm/chart-releaser-action@v1.5.0 + uses: helm/chart-releaser-action@v1.6.0 with: charts_dir: charts config: cr.yaml