Skip to content

Commit 7c6ab83

Browse files
committed
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 <jslagle@redhat.com>
1 parent b7b08af commit 7c6ab83

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

internal/dataplane/util/ansible_execution.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,8 @@ func (a *EEJob) FormatAEEExtraVars(
278278
}
279279

280280
if len(deployment.Spec.ServicesOverride) > 0 {
281-
a.ExtraVars["edpm_services_override"] = json.RawMessage([]byte(fmt.Sprintf("\"%s\"", deployment.Spec.ServicesOverride)))
281+
extraVarsJSON, _ := json.Marshal(deployment.Spec.ServicesOverride)
282+
a.ExtraVars["edpm_services_override"] = json.RawMessage([]byte(fmt.Sprintf("\"%s\"", extraVarsJSON)))
282283
}
283284
}
284285

test/kuttl/tests/dataplane-deploy-tls-test/03-assert.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ spec:
204204
205205
edpm_override_hosts: openstack-edpm-tls
206206
edpm_service_type: tls-dns-ips
207-
edpm_services_override: [install-certs-ovrd tls-dns-ips custom-tls-dns]
207+
edpm_services_override: [install-certs-ovrd, tls-dns-ips, custom-tls-dns]
208208
209209
210210
imagePullPolicy: Always
@@ -315,7 +315,7 @@ spec:
315315
316316
edpm_override_hosts: openstack-edpm-tls
317317
edpm_service_type: custom-tls-dns
318-
edpm_services_override: [install-certs-ovrd tls-dns-ips custom-tls-dns]
318+
edpm_services_override: [install-certs-ovrd, tls-dns-ips, custom-tls-dns]
319319
320320
321321
imagePullPolicy: Always

0 commit comments

Comments
 (0)