Skip to content

host-device: Return interface name in result#1147

Merged
squeed merged 1 commit intocontainernetworking:mainfrom
sriramy:host-device
Mar 3, 2025
Merged

host-device: Return interface name in result#1147
squeed merged 1 commit intocontainernetworking:mainfrom
sriramy:host-device

Conversation

@sriramy
Copy link
Copy Markdown
Contributor

@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
Signed-off-by: Sriram Yagnaraman <sriram.yagnaraman@ericsson.com>
@squeed squeed merged commit bd8da20 into containernetworking:main Mar 3, 2025
6 checks passed
@sriramy sriramy deleted the host-device branch March 9, 2025 13:41
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.

2 participants