Fix NAD config to produce valid JSON for Multus webhook#12
Closed
newgoliath wants to merge 2 commits into
Closed
Conversation
The _config variable was defined as a Python-style dict string with single quotes, which `| to_json` wraps as a quoted string rather than converting to valid JSON. Multus rejects this with "configuration string is not in JSON format". Convert _config to a proper YAML dictionary so `to_json` serializes it correctly with double quotes. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
agonzalezrh
requested changes
Mar 23, 2026
Contributor
agonzalezrh
left a comment
There was a problem hiding this comment.
Is this related to a new ansible version?
Author
yes. I'm migrating the VMware workloads from v1, and there seems to be some code path here that are tool old for v2. |
Author
|
also - it's a little prettier. 😉 |
The CNI plugin expects mtu to be an integer in the NetConf JSON, but the Jinja template produced a string value causing pod sandbox creation to fail with: cannot unmarshal string into Go struct field NetConf.mtu of type int Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
|
@newgoliath use new chain image generated yesterday: chained-2026-04-10 |
Author
|
I thought WK nixed this. Are we still going to use that ee? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
_configvariable increate_network.yamlwas defined as a Python-style dict string with single quotes (e.g.{'cniVersion':'0.3.1', ...})| to_json, Ansible wraps this as a JSON string literal rather than converting it to valid JSON, producing"{'cniVersion':...}"with single quotes"configuration string is not in JSON format"_configto a proper YAML dictionary so| to_jsonserializes it correctly with double quotesTest plan
🤖 Generated with Claude Code