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

Bridge CNI example is incorrect

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • None
    • None
    • CNV Documentation
    • None
    • Quality / Stability / Reliability
    • 3
    • False
    • Hide

      None

      Show
      None
    • False
    • Green
    • None

      Description of problem:

      The example available in our docs https://docs.openshift.com/container-platform/4.16/virt/vm_networking/virt-connecting-vm-to-linux-bridge.html#virt-creating-linux-bridge-nad-cli_virt-connecting-vm-to-linux-bridge is incorrect.

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

      4.14+ for the multiline string
      4.16+ for the boolean

      How reproducible:

      Docs

      Steps to Reproduce:

      1. Go to https://docs.openshift.com/container-platform/4.16/virt/vm_networking/virt-connecting-vm-to-linux-bridge.html#virt-creating-linux-bridge-nad-cli_virt-connecting-vm-to-linux-bridge
      2. "Creating a Linux bridge NAD by using the command line" example
      
      

      Actual results:

      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": false, 
          "vlan": 100, 
          "disableContainerInterface": "true",
          "preserveDefaultVlan": false 
        }'

      Expected results:

      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: | # <<< CHANGED
          {
            "cniVersion": "0.3.1",
            "name": "bridge-network", 
            "type": "cnv-bridge", 
            "bridge": "bridge-interface", 
            "macspoofchk": false, 
            "vlan": 100, 
            "disableContainerInterface": true, # <<< CHANGED
            "preserveDefaultVlan": false 
          }   # <<< CHANGED

      Additional info:

      The existing snippet is not using a valid YAML for multiline string - try pasting it to https://www.yamllint.com/.
      The "disableContainerInterface" should be a boolean https://github.com/containernetworking/plugins/blob/fec2d62676cbe4f2fd587b4840c7fc021bead3f9/plugins/main/bridge/bridge.go#L63.

              sjhala@redhat.com Shikha Jhala
              phoracek@redhat.com Petr Horacek
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: