Uploaded image for project: 'OpenShift Virtualization'
  1. OpenShift Virtualization
  2. CNV-31299

[2224990] User is able to select incompatible network binding

XMLWordPrintable

    • Moderate
    • No

      Description of problem:
      When adding a new network interface to a VM, user is allowed to select an incorrect binding. e.g. They can request an additional bridge network attachment definition and select SR-IOV binding for that. This is bad because of it would always end up with a failure and because it is confusing to the user. This can be easily avoided by setting the binding method automatically.

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

      How reproducible:
      Always

      Steps to Reproduce:
      1. Create a new VM from a Template
      2. Customize Virtual Machine
      3. Network Interfaces
      4. Add network interface
      5. Select a "Network" (NetworkAttachmentDefinition)

      Actual results:
      The "Type" dropdown offers both SR-IOV and Bridge

      Expected results:
      The "Type" is not shown and the UI select the "Type" based on the NetworkAttachmentDefinition's own type.

      Additional info:

      Reading the NetworkAttachmentDefinition type:
      The type in the NetworkAttachmentDefinition can be available in one of two schemas.
      a)
      apiVersion: "k8s.cni.cncf.io/v1"
      kind: NetworkAttachmentDefinition
      metadata:
      name: <bridge-network>
      annotations:
      k8s.v1.cni.cncf.io/resourceName: bridge.network.kubevirt.io/<bridge-interface>
      spec:
      config: '

      { "cniVersion": "0.3.1", "name": "<bridge-network>", "type": "cnv-bridge", # <--------- "bridge": "<bridge-interface>", "macspoofchk": true, "vlan": 1 }

      '
      b)
      apiVersion: "k8s.cni.cncf.io/v1"
      kind: NetworkAttachmentDefinition
      metadata:
      name: <bridge-network>
      annotations:
      k8s.v1.cni.cncf.io/resourceName: bridge.network.kubevirt.io/<bridge-interface>
      spec:
      config: '{
      "cniVersion": "0.3.1",
      "name": "<bridge-network>",
      "plugins": [

      { "type": "cnv-bridge" # <------ first item in the "plugins" list }

      ,

      { "type": "tuning" }

      ]
      }'

      Mapping the NetworkAttachmentDefinition type to binding type:
      bridge -> Bridge
      cnv-bridge -> Bridge
      sriov -> SR-IOV

      Fallback:
      In case we fail to detect the input, we should fall back to showing the dropdown. This can happen when:
      a) RBAC does not allow us to read the NetworkAttachmentDefinition's contents
      b) The NetworkAttachmentDefinition has an incorrect format
      c) The NetworkAttachmentDefinition uses a type that is not supported by the UI (but still may be supported by the backend).

              tnisan@redhat.com Tal Nisan
              phoracek@redhat.com Petr Horacek
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: