Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[test helper] fix nad test helper to return valid json config #581

Merged
merged 1 commit into from
Nov 13, 2024

Conversation

stuggi
Copy link
Contributor

@stuggi stuggi commented Nov 13, 2024

Copy link
Contributor

@olliewalsh olliewalsh left a comment

Choose a reason for hiding this comment

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

/lgtm

@@ -36,7 +36,7 @@ func (tc *TestHelper) CreateNetworkAttachmentDefinition(name types.NamespacedNam
Namespace: name.Namespace,
},
Spec: networkv1.NetworkAttachmentDefinitionSpec{
Config: "",
Config: `{}`,
Copy link
Contributor

Choose a reason for hiding this comment

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

empty string isn't a valid json object I assume?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, unmarshal it as part of https://github.com/openstack-k8s-operators/lib-common/blob/main/modules/common/networkattachment/networkattachment.go#L158 would fail with:

  2024-11-13T15:33:24+01:00     ERROR   Reconciler error        {"controller": "cinder", "controllerGroup": "cinder.openstack.org", "controllerKind": "Cinder", "Cind
er": {"name":"cinder-6af4b","namespace":"4eed3b56-5a11-486a-a472-00a9499f9289"}, "namespace": "4eed3b56-5a11-486a-a472-00a9499f9289", "name": "cinder-6af4b", "reconcileID": "526ff203-812e-4e6e-9608-7f1a28b8084b", "error": "failed create network annotation from [internalapi]: failed to unmarshal JSON data: unexpected end of JSON input"} 

@stuggi stuggi merged commit ff1fd2d into openstack-k8s-operators:main Nov 13, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants