Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

host-device: Return interface name in result #1147

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sriramy
Copy link

@sriramy sriramy commented Feb 20, 2025

It would be nice to see the interface name in network-status pod annotation when called by multus, or other meta plugin when the host device is bound to a userspace driver.

For e.g. when I have a NAD as follows, and attach it to a pod

apiVersion: k8s.cni.cncf.io/v1
kind: NetworkAttachmentDefinition
metadata:
  annotations:
    k8s.v1.cni.cncf.io/resourceName: openshift.io/pci_sriov_vf
  name: net-a
spec:
  config: |-
    {
        "cniVersion": "1.0.0",
        "name": "net-a",
        "type": "host-device",
        "pciBusID": "0000:07:00.0",
        "ipam": {}
    }

k8s.v1.cni.cncf.io/network-status: |-
  [{
      "name": "ovn-kubernetes",
      "interface": "eth0",
      "ips": [
          "fd02:0:0:1::2ed"
      ],
      "mac": "0a:58:70:d0:c0:27",
      "default": true,
      "dns": {}
  },{
      "name": "sriramy/net-a",
      "interface": "net1",
      "dns": {},
      "device-info": {
          "type": "pci",
          "version": "1.1.0",
          "pci": {
              "pci-address": "0000:07:00.0"
          }
      }
  }]
k8s.v1.cni.cncf.io/networks: '[{"name":"net-a","namespace":"sriramy"}]'

What is added is the below line in network status annotation field for net-a
"interface": "net1",

@sriramy sriramy force-pushed the host-device branch 2 times, most recently from e4b1ba1 to cdcee82 Compare February 20, 2025 13:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant