From 7c6ab83e9058b4ccc821b718b5ed04f5efc82188 Mon Sep 17 00:00:00 2001 From: James Slagle Date: Thu, 11 Dec 2025 17:45:04 -0500 Subject: [PATCH] Marshal servicesOverride to JSON before formatting go was formatting the servicesOverride slice without commas between the items, which causes the value to be interpreted as a YAML list of one string item. Marshal'ing the value to JSON first causes proper JSON syntax so that the resulting YAML value is properly formatted with commas. This was breaking the download-cache service that relies on the proper value of edpm_services_override when using download-cache and servicesOverride on a Deployment. Jira: OSPRH-21737 Signed-off-by: James Slagle --- internal/dataplane/util/ansible_execution.go | 3 ++- test/kuttl/tests/dataplane-deploy-tls-test/03-assert.yaml | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/internal/dataplane/util/ansible_execution.go b/internal/dataplane/util/ansible_execution.go index 7930831a1..b33abbc99 100644 --- a/internal/dataplane/util/ansible_execution.go +++ b/internal/dataplane/util/ansible_execution.go @@ -278,7 +278,8 @@ func (a *EEJob) FormatAEEExtraVars( } if len(deployment.Spec.ServicesOverride) > 0 { - a.ExtraVars["edpm_services_override"] = json.RawMessage([]byte(fmt.Sprintf("\"%s\"", deployment.Spec.ServicesOverride))) + extraVarsJSON, _ := json.Marshal(deployment.Spec.ServicesOverride) + a.ExtraVars["edpm_services_override"] = json.RawMessage([]byte(fmt.Sprintf("\"%s\"", extraVarsJSON))) } } diff --git a/test/kuttl/tests/dataplane-deploy-tls-test/03-assert.yaml b/test/kuttl/tests/dataplane-deploy-tls-test/03-assert.yaml index 5e1815f9f..12b5f9d1c 100644 --- a/test/kuttl/tests/dataplane-deploy-tls-test/03-assert.yaml +++ b/test/kuttl/tests/dataplane-deploy-tls-test/03-assert.yaml @@ -204,7 +204,7 @@ spec: edpm_override_hosts: openstack-edpm-tls edpm_service_type: tls-dns-ips - edpm_services_override: [install-certs-ovrd tls-dns-ips custom-tls-dns] + edpm_services_override: [install-certs-ovrd, tls-dns-ips, custom-tls-dns] imagePullPolicy: Always @@ -315,7 +315,7 @@ spec: edpm_override_hosts: openstack-edpm-tls edpm_service_type: custom-tls-dns - edpm_services_override: [install-certs-ovrd tls-dns-ips custom-tls-dns] + edpm_services_override: [install-certs-ovrd, tls-dns-ips, custom-tls-dns] imagePullPolicy: Always