Bug 1831821 - NetworkAttachmentDefinition wizard creates invalid spec for cnv-bridge CNI
Summary: NetworkAttachmentDefinition wizard creates invalid spec for cnv-bridge CNI
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Console Kubevirt Plugin
Version: 4.4
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: 4.4.z
Assignee: Yaacov Zamir
QA Contact: Guohua Ouyang
URL:
Whiteboard:
Depends On: 1832241
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-05-05 17:21 UTC by Petr Horáček
Modified: 2020-06-23 00:57 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: No Doc Update
Doc Text:
Clone Of:
: 1832241 (view as bug list)
Environment:
Last Closed: 2020-06-23 00:57:24 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Github openshift console pull 5290 None closed CNV: Don't set net-attach-def type at root 2020-07-23 15:46:24 UTC
Github openshift console pull 5427 None closed [release-4.4] Bug 1831821: Don't set net-attach-def type at root 2020-07-23 15:46:24 UTC
Red Hat Product Errata RHBA-2020:2580 None None None 2020-06-23 00:57:42 UTC

Description Petr Horáček 2020-05-05 17:21:01 UTC
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"
    }
  ]
}

Comment 1 Petr Horáček 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

Comment 2 Nelly Credi 2020-05-06 07:22:51 UTC
Original issue found on 4.4 
fixing the version

Comment 3 Phillip Bailey 2020-05-09 21:07:50 UTC
Petr, I commented on your PR with what you need to do to fix it. Let me know if that doesn't work for you. Yaacov has already cloned the BZ so we can get it backported. Ping me on Monday and I'll help you with that, as well.

Comment 4 Yaacov Zamir 2020-05-12 16:57:25 UTC
^^

@Petr hi, Philip commented on your PR,

p.s.
did the comment help / do you prefer our team take the PR ?

Comment 5 Petr Horáček 2020-05-12 17:11:43 UTC
Phillip, Yaacov, thanks a lot for the offered help! I'm afraid I was too ambitious (the dream of having a PR merged in console) and I would just slow you down. Please take over it if it does not cause you much troubles.

Comment 6 Yaacov Zamir 2020-05-13 06:06:51 UTC
> Please take over it if it does not cause you much troubles.

No problems +1
Will take the BZ and keep you updated

p.s.
If you do find some time, feel free to continue this PR or open others, help is appreciated.

Comment 7 Yaacov Zamir 2020-05-13 13:47:48 UTC
Submitted upstream:
https://github.com/openshift/console/pull/5427

Comment 8 Yaacov Zamir 2020-06-11 09:29:05 UTC
merged upstream:
https://github.com/openshift/console/pull/5427

Comment 11 Guohua Ouyang 2020-06-17 12:22:44 UTC
tested on upstream 4.4 branch with commit ef3268ae549554e51b2a96b8a9771553e23901dd
Now it looks like `{"name":"test","cniVersion":"0.3.1","plugins":[{"type":"cnv-bridge","bridge":"br1","ipam":{}},{"type":"cnv-tuning"}]}`, the bug is fixed.

Comment 13 errata-xmlrpc 2020-06-23 00:57:24 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:2580


Note You need to log in before you can comment on or make changes to this bug.