Skip to content

[neutron_adoption] Fix JSON serialization for ml2 baremetal patch#1385

Closed
rebtoor wants to merge 1 commit into
openstack-k8s-operators:mainfrom
rebtoor:fix-ironic-ml2
Closed

[neutron_adoption] Fix JSON serialization for ml2 baremetal patch#1385
rebtoor wants to merge 1 commit into
openstack-k8s-operators:mainfrom
rebtoor:fix-ironic-ml2

Conversation

@rebtoor
Copy link
Copy Markdown
Contributor

@rebtoor rebtoor commented May 12, 2026

The ironic_ml2_baremetal_patch variable is a YAML dict, not a string. Without the to_json filter, Ansible renders it as a Python repr with single quotes, which oc patch rejects as invalid JSON. This breaks adoption jobs that include ironic (e.g. uni04delta-ipv6).

e.g.

TASK [neutron_adoption : Patch neutron ml2MechanismDrivers to inlcude ml2 baremetal] ***
fatal: [localhost]: FAILED! => {"changed": true, "cmd": "set -euxo pipefail\n\n\noc patch openstackcontrolplane openstack --type=merge --patch '{'spec': {'neutron': {'template': {'ml2MechanismDrivers': ['ovn', 'baremetal']}}}}'\n", "delta": "0:00:00.165346", "end": "2026-05-12 03:16:53.552724", "msg": "non-zero return code", "rc": 1, "start": "2026-05-12 03:16:53.387378", "stderr": "+ oc patch openstackcontrolplane openstack --type=merge --patch '{spec: {neutron: {template: {ml2MechanismDrivers: [ovn, baremetal]}}}}'\nError from server (BadRequest): error decoding patch: invalid character 's' looking for beginning of object key string", "stderr_lines": ["+ oc patch openstackcontrolplane openstack --type=merge --patch '{spec: {neutron: {template: {ml2MechanismDrivers: [ovn, baremetal]}}}}'", "Error from server (BadRequest): error decoding patch: invalid character 's' looking for beginning of object key string"], "stdout": "", "stdout_lines": []}

Co-Authored-By: Cursor (claude-sonnet-4-20250514)

The ironic_ml2_baremetal_patch variable is a YAML dict, not a string.
Without the to_json filter, Ansible renders it as a Python repr with
single quotes, which oc patch rejects as invalid JSON. This breaks
adoption jobs that include ironic (e.g. uni04delta-ipv6).

Co-Authored-By: Cursor (claude-sonnet-4-20250514)

Signed-off-by: Roberto Alfieri <ralfieri@redhat.com>
@rebtoor rebtoor requested review from a team and hjensas May 12, 2026 08:27
@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented May 12, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign jistr for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ciecierski
Copy link
Copy Markdown
Contributor

@rebtoor This is duplicate to change #1381

@rebtoor
Copy link
Copy Markdown
Contributor Author

rebtoor commented May 12, 2026

argh, sorry @ciecierski , didn't see that. I'm closing this one than.

@rebtoor rebtoor closed this May 12, 2026
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