From 3d8844ef7e0f76b7c8fe66231e5ce639acdbfbe2 Mon Sep 17 00:00:00 2001 From: Thales Elero Cervi Date: Mon, 8 Aug 2022 19:36:14 -0300 Subject: [PATCH] Making mariadb (osh-i) char helm v3 compatible The patch added by this change will make openstack-helm-infra mariadb chart syntax compatible with FluxCD (helmv3). Tests done with osh-i charts as they were used on our armada app failed with helm release render errors. Test Plan: PASS - build-helm-charts.sh builds a basic FluxCD and a complete Armada app tarball PASS - application upload and overrides generated PASS - application apply/remove/delete Closes-Bug: 1987705 Signed-off-by: Thales Elero Cervi Change-Id: Ie26ebd10833e797652e24d4736d15d8c89cba1e4 --- .../centos/openstack-helm-infra.spec | 2 ++ ...-templates-syntax-for-fluxcd-helm-v3.patch | 29 +++++++++++++++++++ .../debian/deb_folder/patches/series | 3 +- ...-templates-syntax-for-fluxcd-helm-v3.patch | 29 +++++++++++++++++++ 4 files changed, 62 insertions(+), 1 deletion(-) create mode 100644 openstack-helm-infra/debian/deb_folder/patches/0025-Update-templates-syntax-for-fluxcd-helm-v3.patch create mode 100644 openstack-helm-infra/files/0025-Update-templates-syntax-for-fluxcd-helm-v3.patch diff --git a/openstack-helm-infra/centos/openstack-helm-infra.spec b/openstack-helm-infra/centos/openstack-helm-infra.spec index 44ffcb2f..09ded074 100644 --- a/openstack-helm-infra/centos/openstack-helm-infra.spec +++ b/openstack-helm-infra/centos/openstack-helm-infra.spec @@ -32,6 +32,7 @@ Patch21: 0021-Remove-mariadb-tls.patch Patch22: 0022-Remove-rabbitmq-tls.patch Patch23: 0023-Update-RabbitMQ-probes.patch Patch24: 0024-Update-openstack-Ingress-for-networking-api-v1.patch +Patch25: 0025-Update-templates-syntax-for-fluxcd-helm-v3.patch BuildRequires: helm BuildRequires: chartmuseum @@ -58,6 +59,7 @@ Openstack Helm Infra charts %patch22 -p1 %patch23 -p1 %patch24 -p1 +%patch25 -p1 %build # Host a server for the charts diff --git a/openstack-helm-infra/debian/deb_folder/patches/0025-Update-templates-syntax-for-fluxcd-helm-v3.patch b/openstack-helm-infra/debian/deb_folder/patches/0025-Update-templates-syntax-for-fluxcd-helm-v3.patch new file mode 100644 index 00000000..e0ceb31c --- /dev/null +++ b/openstack-helm-infra/debian/deb_folder/patches/0025-Update-templates-syntax-for-fluxcd-helm-v3.patch @@ -0,0 +1,29 @@ +From cd93bff5ca808e5a58c10f5f7e9b882357188923 Mon Sep 17 00:00:00 2001 +From: Thales Elero Cervi +Date: Mon, 8 Aug 2022 16:42:03 -0300 +Subject: [PATCH] Update templates syntax for fluxcd helm v3 + +The code changes here are needed in order for the stx-openstack +application to work after the FluxCD migration. +Some parsing/rendering differences were noticed between +Armada (helmv2) and FluxCD (helmv3). + +Signed-off-by: Thales Elero Cervi +--- + mariadb/templates/configmap-services-tcp.yaml | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/mariadb/templates/configmap-services-tcp.yaml b/mariadb/templates/configmap-services-tcp.yaml +index 5b3a7afd..0cd6cb1e 100644 +--- a/mariadb/templates/configmap-services-tcp.yaml ++++ b/mariadb/templates/configmap-services-tcp.yaml +@@ -20,5 +20,5 @@ kind: ConfigMap + metadata: + name: mariadb-services-tcp + data: +- {{ tuple "oslo_db" "internal" "mysql" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}: "{{ .Release.Namespace }}/{{ tuple "oslo_db" "direct" . | include "helm-toolkit.endpoints.hostname_short_endpoint_lookup" }}:{{ tuple "oslo_db" "direct" "mysql" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}" ++ {{ tuple "oslo_db" "internal" "mysql" . | include "helm-toolkit.endpoints.endpoint_port_lookup" | quote }}: "{{ .Release.Namespace }}/{{ tuple "oslo_db" "direct" . | include "helm-toolkit.endpoints.hostname_short_endpoint_lookup" }}:{{ tuple "oslo_db" "direct" "mysql" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}" + {{- end }} +-- +2.25.1 + diff --git a/openstack-helm-infra/debian/deb_folder/patches/series b/openstack-helm-infra/debian/deb_folder/patches/series index 285c05e3..d19e5c63 100644 --- a/openstack-helm-infra/debian/deb_folder/patches/series +++ b/openstack-helm-infra/debian/deb_folder/patches/series @@ -14,4 +14,5 @@ 0021-Remove-mariadb-tls.patch 0022-Remove-rabbitmq-tls.patch 0023-Update-RabbitMQ-probes.patch -0024-Update-openstack-Ingress-for-networking-api-v1.patch \ No newline at end of file +0024-Update-openstack-Ingress-for-networking-api-v1.patch +0025-Update-templates-syntax-for-fluxcd-helm-v3.patch diff --git a/openstack-helm-infra/files/0025-Update-templates-syntax-for-fluxcd-helm-v3.patch b/openstack-helm-infra/files/0025-Update-templates-syntax-for-fluxcd-helm-v3.patch new file mode 100644 index 00000000..e0ceb31c --- /dev/null +++ b/openstack-helm-infra/files/0025-Update-templates-syntax-for-fluxcd-helm-v3.patch @@ -0,0 +1,29 @@ +From cd93bff5ca808e5a58c10f5f7e9b882357188923 Mon Sep 17 00:00:00 2001 +From: Thales Elero Cervi +Date: Mon, 8 Aug 2022 16:42:03 -0300 +Subject: [PATCH] Update templates syntax for fluxcd helm v3 + +The code changes here are needed in order for the stx-openstack +application to work after the FluxCD migration. +Some parsing/rendering differences were noticed between +Armada (helmv2) and FluxCD (helmv3). + +Signed-off-by: Thales Elero Cervi +--- + mariadb/templates/configmap-services-tcp.yaml | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/mariadb/templates/configmap-services-tcp.yaml b/mariadb/templates/configmap-services-tcp.yaml +index 5b3a7afd..0cd6cb1e 100644 +--- a/mariadb/templates/configmap-services-tcp.yaml ++++ b/mariadb/templates/configmap-services-tcp.yaml +@@ -20,5 +20,5 @@ kind: ConfigMap + metadata: + name: mariadb-services-tcp + data: +- {{ tuple "oslo_db" "internal" "mysql" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}: "{{ .Release.Namespace }}/{{ tuple "oslo_db" "direct" . | include "helm-toolkit.endpoints.hostname_short_endpoint_lookup" }}:{{ tuple "oslo_db" "direct" "mysql" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}" ++ {{ tuple "oslo_db" "internal" "mysql" . | include "helm-toolkit.endpoints.endpoint_port_lookup" | quote }}: "{{ .Release.Namespace }}/{{ tuple "oslo_db" "direct" . | include "helm-toolkit.endpoints.hostname_short_endpoint_lookup" }}:{{ tuple "oslo_db" "direct" "mysql" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}" + {{- end }} +-- +2.25.1 +