fix: infra-openshift-cnv-resources network config not valid JSON#9776
Open
prakhar1985 wants to merge 2 commits intodevelopmentfrom
Open
fix: infra-openshift-cnv-resources network config not valid JSON#9776prakhar1985 wants to merge 2 commits intodevelopmentfrom
prakhar1985 wants to merge 2 commits intodevelopmentfrom
Conversation
The config var was defined as a single-quoted Python dict string. Applying | to_json to a string just wraps it in quotes rather than converting it to valid JSON, causing Multus webhook to reject the NetworkAttachmentDefinition with 'configuration string is not in JSON format'. Defining config as a proper YAML dict ensures | to_json produces valid JSON that Multus accepts.
local_bastion is a string (VM name). ansible-core 2.18 requires conditionals to return a boolean, not a string. 'local_bastion is defined' correctly checks if the bastion was found without relying on string truthiness.
Collaborator
|
Use EE chain 4-10 |
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.
Problem
infra-openshift-cnv-resources/tasks/create_network.yamldefinesconfigas a Python-style dict string (single quotes):
```yaml
config: "{'cniVersion':'0.3.1','type':'ovn-k8s-cni-overlay',...}"
```
Applying
| to_jsonto a string just wraps it in JSON string quotesrather than converting the content to JSON. Multus webhook rejects the
resulting NetworkAttachmentDefinition:
```
admission webhook "multus-validating-config.k8s.io" denied the request:
configuration string is not in JSON format
```
Fix
Define
configas a proper YAML dict.| to_jsonon a dict producesvalid JSON that Multus accepts.
Affects
lb1404 and any other catalog item using
infra-openshift-cnv-resourceswith CNV network attachment definitions.