From f0fc41f62fb40a2657a9b1307e2a08e179378eca Mon Sep 17 00:00:00 2001 From: pmacius Date: Tue, 15 Oct 2024 11:25:22 +0200 Subject: [PATCH] change values names --- charts/alfresco-audit-storage/README.md | 28 +++++++++---------- .../ci/default-values.yaml | 4 +-- .../templates/_helpers-activemq.tpl | 6 ++-- .../templates/_helpers-elasticsearch.tpl | 4 +-- .../templates/configmap-es.yaml | 4 +-- .../templates/configmap-mq.yaml | 2 +- .../templates/secret-es.yaml | 2 +- .../templates/secret-mq.yaml | 2 +- .../tests/configmaps_test.yaml | 6 ++-- .../tests/deployment_test.yaml | 4 +-- .../tests/secret-es_test.yaml | 4 +-- .../tests/secret-mq_test.yaml | 4 +-- .../tests/values/embedded-charts-values.yaml | 4 +-- charts/alfresco-audit-storage/values.yaml | 4 +-- 14 files changed, 39 insertions(+), 39 deletions(-) diff --git a/charts/alfresco-audit-storage/README.md b/charts/alfresco-audit-storage/README.md index 998c0555..e63fb3b4 100644 --- a/charts/alfresco-audit-storage/README.md +++ b/charts/alfresco-audit-storage/README.md @@ -24,14 +24,6 @@ Checkout [alfresco-content-services chart's doc](https://github.com/Alfresco/acs | Key | Type | Default | Description | |-----|------|---------|-------------| | affinity | object | `{}` | | -| elasticSearchConnection.existingConfigMap.keys.url | string | `"SEARCH_URL"` | Key within the configmap holding the URL of the elasticsearch service | -| elasticSearchConnection.existingConfigMap.name | string | `nil` | Alternatively, provide elasticsearch service connection details via an existing configmap | -| elasticSearchConnection.existingSecret.keys.password | string | `"SEARCH_PASSWORD"` | Key within the secret that holds the elasticsearch password | -| elasticSearchConnection.existingSecret.keys.username | string | `"SEARCH_USERNAME"` | Key within the secret that holds the elasticsearch username | -| elasticSearchConnection.existingSecret.name | string | `nil` | Alternatively, provide elasticsearch credentials via an existing secret | -| elasticSearchConnection.password | string | `nil` | The password required to access the elasticsearch service, if any | -| elasticSearchConnection.url | string | `nil` | The URL where the elasticsearch service is available | -| elasticSearchConnection.username | string | `nil` | The username required to access the elasticsearch service, if any | | environment.AUDIT_EVENTINGESTION_DLQ_CONSUMEPERIOD | int | `60000` | | | environment.AUDIT_EVENTINGESTION_DLQ_CONSUMPTIONCOUNT | int | `1000` | | | environment.AUDIT_EVENTINGESTION_URI | string | `"activemq:topic:alfresco.repo.event2"` | | @@ -42,16 +34,24 @@ Checkout [alfresco-content-services chart's doc](https://github.com/Alfresco/acs | image.repository | string | `"quay.io/alfresco/alfresco-audit-storage"` | | | image.tag | string | `"0.0.1-A8"` | | | imagePullSecrets | list | `[]` | | +| index.existingConfigMap.keys.url | string | `"SEARCH_URL"` | Key within the configmap holding the URL of the elasticsearch service | +| index.existingConfigMap.name | string | `nil` | Alternatively, provide elasticsearch service connection details via an existing configmap | +| index.existingSecret.keys.password | string | `"SEARCH_PASSWORD"` | Key within the secret that holds the elasticsearch password | +| index.existingSecret.keys.username | string | `"SEARCH_USERNAME"` | Key within the secret that holds the elasticsearch username | +| index.existingSecret.name | string | `nil` | Alternatively, provide elasticsearch credentials via an existing secret | +| index.password | string | `nil` | The password required to access the elasticsearch service, if any | +| index.url | string | `nil` | The URL where the elasticsearch service is available | +| index.username | string | `nil` | The username required to access the elasticsearch service, if any | | livenessProbe.httpGet.path | string | `"/actuator/health/liveness"` | | | livenessProbe.httpGet.port | string | `"http"` | | | livenessProbe.initialDelaySeconds | int | `15` | | | livenessProbe.periodSeconds | int | `60` | | -| messageBrokerConnection.existingConfigMap.keys.url | string | `"BROKER_URL"` | Key within the configmap holding the URL of the message broker | -| messageBrokerConnection.existingConfigMap.name | string | `nil` | Alternatively, provide message broker connection details via an existing configmap | -| messageBrokerConnection.existingSecret | object | `{"keys":{"password":"BROKER_PASSWORD","username":"BROKER_USERNAME"},"name":null}` | Provide connection details alternatively via an existing secret that contains BROKER_URL, BROKER_USERNAME and BROKER_PASSWORD keys | -| messageBrokerConnection.password | string | `nil` | Broker password | -| messageBrokerConnection.url | string | `nil` | Broker URL formatted as per: https://activemq.apache.org/failover-transport-reference | -| messageBrokerConnection.username | string | `nil` | Broker username | +| messageBroker.existingConfigMap.keys.url | string | `"BROKER_URL"` | Key within the configmap holding the URL of the message broker | +| messageBroker.existingConfigMap.name | string | `nil` | Alternatively, provide message broker connection details via an existing configmap | +| messageBroker.existingSecret | object | `{"keys":{"password":"BROKER_PASSWORD","username":"BROKER_USERNAME"},"name":null}` | Provide connection details alternatively via an existing secret that contains BROKER_URL, BROKER_USERNAME and BROKER_PASSWORD keys | +| messageBroker.password | string | `nil` | Broker password | +| messageBroker.url | string | `nil` | Broker URL formatted as per: https://activemq.apache.org/failover-transport-reference | +| messageBroker.username | string | `nil` | Broker username | | nameOverride | string | `""` | | | nodeSelector | object | `{}` | | | podAnnotations | object | `{}` | | diff --git a/charts/alfresco-audit-storage/ci/default-values.yaml b/charts/alfresco-audit-storage/ci/default-values.yaml index 729c77f7..c04364e9 100644 --- a/charts/alfresco-audit-storage/ci/default-values.yaml +++ b/charts/alfresco-audit-storage/ci/default-values.yaml @@ -26,9 +26,9 @@ activemq: limits: cpu: "1000m" memory: "1Gi" -elasticSearchConnection: +index: url: http://elasticsearch-master:9200 -messageBrokerConnection: +messageBroker: url: nio://activemq-broker:61616 tags: ci: true diff --git a/charts/alfresco-audit-storage/templates/_helpers-activemq.tpl b/charts/alfresco-audit-storage/templates/_helpers-activemq.tpl index e7af7bda..059afd97 100644 --- a/charts/alfresco-audit-storage/templates/_helpers-activemq.tpl +++ b/charts/alfresco-audit-storage/templates/_helpers-activemq.tpl @@ -4,7 +4,7 @@ Usage: include "alfresco-audit-storage.activemq.url" $ */}} {{- define "alfresco-audit-storage.activemq.url" -}} -{{- required "You need to provide an ActiveMQ URL using messageBrokerConnection.url or using an existingConfigMap check chart README file" $.Values.messageBrokerConnection.url }} +{{- required "You need to provide an ActiveMQ URL using messageBroker.url or using an existingConfigMap check chart README file" $.Values.messageBroker.url }} {{- end -}} {{/* @@ -14,7 +14,7 @@ Usage: include "alfresco-audit-storage.activemq.cm.env" $ */}} {{- define "alfresco-audit-storage.activemq.cm.env" -}} {{- $mqCtx := dict "Values" (dict "nameOverride" (printf "%s-%s" (.Values.nameOverride | default $.Chart.Name) "mq")) "Chart" .Chart "Release" .Release }} -{{- with .Values.messageBrokerConnection }} +{{- with .Values.messageBroker }} {{- $mqCm := coalesce .existingConfigMap.name (include "alfresco-audit-storage.fullname" $mqCtx) }} - name: SPRING_ACTIVEMQ_BROKERURL valueFrom: @@ -31,7 +31,7 @@ Usage: include "alfresco-audit-storage.activemq.secret.env" $ */}} {{- define "alfresco-audit-storage.activemq.secret.env" -}} {{- $mqCtx := dict "Values" (dict "nameOverride" (printf "%s-%s" (.Values.nameOverride | default .Chart.Name) "mq")) "Chart" .Chart "Release" .Release }} -{{- with .Values.messageBrokerConnection }} +{{- with .Values.messageBroker }} {{- $mqSecret := coalesce .existingSecret.name (include "alfresco-audit-storage.fullname" $mqCtx) }} - name: SPRING_ACTIVEMQ_USER valueFrom: diff --git a/charts/alfresco-audit-storage/templates/_helpers-elasticsearch.tpl b/charts/alfresco-audit-storage/templates/_helpers-elasticsearch.tpl index e767197b..77822147 100644 --- a/charts/alfresco-audit-storage/templates/_helpers-elasticsearch.tpl +++ b/charts/alfresco-audit-storage/templates/_helpers-elasticsearch.tpl @@ -5,7 +5,7 @@ Usage: include "alfresco-audit-storage.config.audit.entryStorage.es.env" $ */}} {{- define "alfresco-audit-storage.config.audit.entryStorage.es.env" -}} {{- $esCtx := dict "Values" (dict "nameOverride" (printf "%s-%s" (.Values.nameOverride | default .Chart.Name) "es")) "Chart" .Chart "Release" .Release }} -{{- with .Values.elasticSearchConnection }} +{{- with .Values.index }} {{- $esCm := coalesce .existingConfigMap.name (include "alfresco-audit-storage.fullname" $esCtx) }} - name: AUDIT_ENTRYSTORAGE_OPENSEARCH_CONNECTOR_URI valueFrom: @@ -22,7 +22,7 @@ Usage: include "alfresco-audit-storage.config.audit.entryStorage.envCredentials" */}} {{- define "alfresco-audit-storage.config.audit.entryStorage.envCredentials" -}} {{- $esCtx := dict "Values" (dict "nameOverride" (printf "%s-%s" (.Values.nameOverride | default .Chart.Name) "es")) "Chart" .Chart "Release" .Release }} -{{- with .Values.elasticSearchConnection }} +{{- with .Values.index }} {{- $esSecret := coalesce .existingSecret.name (include "alfresco-audit-storage.fullname" $esCtx) }} - name: AUDIT_ENTRYSTORAGE_OPENSEARCH_CONNECTOR_USERNAME valueFrom: diff --git a/charts/alfresco-audit-storage/templates/configmap-es.yaml b/charts/alfresco-audit-storage/templates/configmap-es.yaml index 0f45a82f..0ef5f430 100644 --- a/charts/alfresco-audit-storage/templates/configmap-es.yaml +++ b/charts/alfresco-audit-storage/templates/configmap-es.yaml @@ -1,4 +1,4 @@ -{{- with .Values.elasticSearchConnection }} +{{- with .Values.index }} {{- if not .existingConfigMap.name }} apiVersion: v1 kind: ConfigMap @@ -8,7 +8,7 @@ metadata: labels: {{- include "alfresco-audit-storage.labels" $ | nindent 4 }} data: - {{- $reqMsg := "Please provide elasticsearch connection details as .elasticSearchConnection.url values or using an .elasticSearchConnection.existingConfigMap." }} + {{- $reqMsg := "Please provide elasticsearch connection details as .index.url values or using an .index.existingConfigMap." }} {{- $esProtocol := required $reqMsg (include "alfresco-common.url.scheme" .url) }} {{- $esHost := required $reqMsg (include "alfresco-common.url.host" .url) }} {{- $esPort := required $reqMsg (include "alfresco-common.url.port" .url) }} diff --git a/charts/alfresco-audit-storage/templates/configmap-mq.yaml b/charts/alfresco-audit-storage/templates/configmap-mq.yaml index e370f917..7def1a5f 100644 --- a/charts/alfresco-audit-storage/templates/configmap-mq.yaml +++ b/charts/alfresco-audit-storage/templates/configmap-mq.yaml @@ -1,4 +1,4 @@ -{{- if not .Values.messageBrokerConnection.existingConfigMap.name -}} +{{- if not .Values.messageBroker.existingConfigMap.name -}} apiVersion: v1 kind: ConfigMap metadata: diff --git a/charts/alfresco-audit-storage/templates/secret-es.yaml b/charts/alfresco-audit-storage/templates/secret-es.yaml index 645c020d..49753cf7 100644 --- a/charts/alfresco-audit-storage/templates/secret-es.yaml +++ b/charts/alfresco-audit-storage/templates/secret-es.yaml @@ -1,4 +1,4 @@ -{{- with .Values.elasticSearchConnection }} +{{- with .Values.index }} {{- if not .existingSecret.name }} apiVersion: v1 kind: Secret diff --git a/charts/alfresco-audit-storage/templates/secret-mq.yaml b/charts/alfresco-audit-storage/templates/secret-mq.yaml index f8ddb5ab..a291dc09 100644 --- a/charts/alfresco-audit-storage/templates/secret-mq.yaml +++ b/charts/alfresco-audit-storage/templates/secret-mq.yaml @@ -1,4 +1,4 @@ -{{- with .Values.messageBrokerConnection }} +{{- with .Values.messageBroker }} {{- if not .existingSecret.name }} apiVersion: v1 kind: Secret diff --git a/charts/alfresco-audit-storage/tests/configmaps_test.yaml b/charts/alfresco-audit-storage/tests/configmaps_test.yaml index f57ac131..fc16d635 100644 --- a/charts/alfresco-audit-storage/tests/configmaps_test.yaml +++ b/charts/alfresco-audit-storage/tests/configmaps_test.yaml @@ -8,7 +8,7 @@ tests: asserts: - failedTemplate: errorMessage: >- - You need to provide an ActiveMQ URL using messageBrokerConnection.url or using an existingConfigMap check chart README file + You need to provide an ActiveMQ URL using messageBroker.url or using an existingConfigMap check chart README file template: configmap-mq.yaml - it: should create a cm from messageBroker provided values @@ -27,9 +27,9 @@ tests: - it: should not render cm when existingConfigMap is set values: *testvalues set: - elasticSearchConnection.existingConfigMap: + index.existingConfigMap: name: external-mq-configmap - messageBrokerConnection.existingConfigMap: + messageBroker.existingConfigMap: name: external-es-configmap asserts: - hasDocuments: diff --git a/charts/alfresco-audit-storage/tests/deployment_test.yaml b/charts/alfresco-audit-storage/tests/deployment_test.yaml index ff9be708..6ae78755 100644 --- a/charts/alfresco-audit-storage/tests/deployment_test.yaml +++ b/charts/alfresco-audit-storage/tests/deployment_test.yaml @@ -57,7 +57,7 @@ tests: protocol: TCP - it: should have envs section with external cm and secrets set: - messageBrokerConnection: + messageBroker: existingConfigMap: name: mq-external-config keys: @@ -67,7 +67,7 @@ tests: keys: username: BROKER_USERNAME_EXTERNAL password: BROKER_PASSWORD_EXTERNAL - elasticSearchConnection: + index: existingConfigMap: name: es-external-config keys: diff --git a/charts/alfresco-audit-storage/tests/secret-es_test.yaml b/charts/alfresco-audit-storage/tests/secret-es_test.yaml index 0fd1d72b..b787a3c0 100644 --- a/charts/alfresco-audit-storage/tests/secret-es_test.yaml +++ b/charts/alfresco-audit-storage/tests/secret-es_test.yaml @@ -14,7 +14,7 @@ tests: - it: should have credentials populated when credentials are set set: - elasticSearchConnection: + index: username: admin password: letmein asserts: @@ -27,7 +27,7 @@ tests: - it: should not have a secret when existingSecret is set set: - elasticSearchConnection: + index: existingSecret: name: whatever asserts: diff --git a/charts/alfresco-audit-storage/tests/secret-mq_test.yaml b/charts/alfresco-audit-storage/tests/secret-mq_test.yaml index 5e1fc6ad..12123a35 100644 --- a/charts/alfresco-audit-storage/tests/secret-mq_test.yaml +++ b/charts/alfresco-audit-storage/tests/secret-mq_test.yaml @@ -14,7 +14,7 @@ tests: - it: should have credentials populated when messagebroker values are set set: - messageBrokerConnection: + messageBroker: url: ssl://mq.domain.tld:61617 username: ext-admin password: ext-pass @@ -28,7 +28,7 @@ tests: - it: should not have a secret when existingSecretName is set set: - messageBrokerConnection.existingSecret.name: existing-secret + messageBroker.existingSecret.name: existing-secret asserts: - hasDocuments: count: 0 diff --git a/charts/alfresco-audit-storage/tests/values/embedded-charts-values.yaml b/charts/alfresco-audit-storage/tests/values/embedded-charts-values.yaml index fd7f6685..d250e8a1 100644 --- a/charts/alfresco-audit-storage/tests/values/embedded-charts-values.yaml +++ b/charts/alfresco-audit-storage/tests/values/embedded-charts-values.yaml @@ -1,4 +1,4 @@ -elasticSearchConnection: +index: url: http://elasticsearch-master:9200 -messageBrokerConnection: +messageBroker: url: nio://activemq-broker:61616 diff --git a/charts/alfresco-audit-storage/values.yaml b/charts/alfresco-audit-storage/values.yaml index 15e49cc2..d7f16167 100644 --- a/charts/alfresco-audit-storage/values.yaml +++ b/charts/alfresco-audit-storage/values.yaml @@ -31,7 +31,7 @@ environment: AUDIT_EVENTINGESTION_DLQ_CONSUMPTIONCOUNT: 1000 SPRING_PROFILES_ACTIVE: "durable-subscriptions" -messageBrokerConnection: +messageBroker: # -- Broker URL formatted as per: # https://activemq.apache.org/failover-transport-reference url: null @@ -54,7 +54,7 @@ messageBrokerConnection: username: BROKER_USERNAME password: BROKER_PASSWORD -elasticSearchConnection: +index: # -- The URL where the elasticsearch service is available url: null # -- The username required to access the elasticsearch service, if any