Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion internal/dataplane/util/ansible_execution.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like this err should probably be checked, no?

I understand that is complicated by the fact that this function doesn't return anything and changing the signature of the function isn't nice. It is only used in one place though, so probably not the end of the world to update the signature to:

func (a *EEJob) FormatAEEExtraVars(
	aeeSpec *dataplanev1.AnsibleEESpec,
	service *dataplanev1.OpenStackDataPlaneService,
	deployment *dataplanev1.OpenStackDataPlaneDeployment,
	nodeSet client.Object,
) error {
}

Which does also necessitate changing the signature of BuildAeeJobSpec to also return an error to facilitate back propagating the error. But I think it would probably be nicer if the error was captured and returned rather than silently dropped.

a.ExtraVars["edpm_services_override"] = json.RawMessage([]byte(fmt.Sprintf("\"%s\"", extraVarsJSON)))
}
}

Expand Down
4 changes: 2 additions & 2 deletions test/kuttl/tests/dataplane-deploy-tls-test/03-assert.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down