Skip to content

Commit d90cf64

Browse files
committed
Don't Unmarshal edpm_services_override
edpm_services_override is already marshal'd to JSON in ansible_execution.go, so there's no need to unmarshal and print it to string, b/c go drops the commas from the marshal'd value. 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 c36996f commit d90cf64

3 files changed

Lines changed: 7 additions & 3 deletions

File tree

internal/dataplane/util/ansible_execution.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ 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+
a.ExtraVars["edpm_services_override"], _ = json.Marshal(deployment.Spec.ServicesOverride)
282282
}
283283
}
284284

internal/dataplane/util/ansibleee.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,10 @@ func (a *EEJob) JobForOpenStackAnsibleEE(h *helper.Helper) (*batchv1.Job, error)
183183
parsedExtraVars := ""
184184
// unmarshal nested data structures
185185
for _, variable := range keys {
186+
if variable == "edpm_services_override" {
187+
parsedExtraVars += fmt.Sprintf("%s: %s\n", variable, a.ExtraVars[variable])
188+
continue
189+
}
186190
var tmp interface{}
187191
err := yaml.Unmarshal(a.ExtraVars[variable], &tmp)
188192
if err != nil {

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)