Bug 1832241

Summary: NetworkAttachmentDefinition wizard creates invalid spec for cnv-bridge CNI
Product: OpenShift Container Platform Reporter: Yaacov Zamir <yzamir>
Component: Console Kubevirt PluginAssignee: Yaacov Zamir <yzamir>
Status: CLOSED ERRATA QA Contact: Guohua Ouyang <gouyang>
Severity: medium Docs Contact:
Priority: medium    
Version: 4.4CC: aos-bugs, gouyang, ncredi, phbailey, phoracek, tjelinek, yzamir
Target Milestone: ---   
Target Release: 4.5.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: 1831821 Environment:
Last Closed: 2020-07-13 17:35:22 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1831821    

Description Yaacov Zamir 2020-05-06 11:29:15 UTC
+++ This bug was initially created as a clone of Bug #1831821 +++

Description of problem:
The NetworkAttachmentDefinition wizard in console creates an invalid config for cnv-bridge CNI. The generated config has "plugin" attribute set in the root of the "config". Due to that, the "plugins" list is ignored and the CNI plugin uses defaults for all the attribute. That results in bridge "cni0" created on a node (instead of the bridge specified in the UI).


Version-Release number of selected component (if applicable):
OCP 4.5


How reproducible:
Always


Steps to Reproduce:
1. Create cnv-bridge CNI network in the NetworkAttachmentDefinition wizard

Actual results:
oc get network-attachment-definitions.k8s.cni.cncf.io/via-gui -o jsonpath={.spec.config} | jq
{
  "name": "via-gui",
  "type": "cnv-bridge", <<<< should not be there
  "cniVersion": "0.3.1",
  "plugins": [
    {
      "type": "cnv-bridge", <<< should be only here
      "bridge": "br99999",
      "ipam": {}
    },
    {
      "type": "cnv-tuning"
    }
  ]
}


Expected results:
oc get network-attachment-definitions.k8s.cni.cncf.io/via-gui -o jsonpath={.spec.config} | jq
{
  "name": "via-gui",
  "cniVersion": "0.3.1",
  "plugins": [
    {
      "type": "cnv-bridge",
      "bridge": "br99999",
      "ipam": {}
    },
    {
      "type": "cnv-tuning"
    }
  ]
}

--- Additional comment from Petr Horáček on 2020-05-05 17:23:32 UTC ---

Phillip, I have tried to create the needed PR on console myself, but as expected, it went terribly wrong. Would you be so kind and helped me get it into an acceptable shape? Thanks. https://github.com/openshift/console/pull/5290

--- Additional comment from Nelly Credi on 2020-05-06 07:22:51 UTC ---

Original issue found on 4.4 
fixing the version

Comment 1 Yaacov Zamir 2020-05-13 13:16:53 UTC
sorry wrong bug, moving back to post

Comment 4 Guohua Ouyang 2020-05-21 03:56:13 UTC
verified on upstream 4.5 branch, it's {"name":"test","cniVersion":"0.3.1","plugins":[{"type":"cnv-bridge","bridge":"b1","ipam":{}},{"type":"cnv-tuning"}]}

Comment 5 errata-xmlrpc 2020-07-13 17:35:22 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2020:2409