diff --git a/pkg/types/conf.go b/pkg/types/conf.go index 4402b4ec7..b66dcbd95 100644 --- a/pkg/types/conf.go +++ b/pkg/types/conf.go @@ -268,6 +268,9 @@ func newCNIRuntimeConf(containerID, sandboxID, podName, podNamespace, podUID, ne if delegateRc.CNIDeviceInfoFile != "" { capabilityArgs["CNIDeviceInfoFile"] = delegateRc.CNIDeviceInfoFile } + if delegateRc.PodAnnotations != nil { + capabilityArgs["io.kubernetes.cri.pod-annotations"] = delegateRc.PodAnnotations + } rt.CapabilityArgs = capabilityArgs } return rt, cniDeviceInfoFile diff --git a/pkg/types/types.go b/pkg/types/types.go index 1a410db59..779823028 100644 --- a/pkg/types/types.go +++ b/pkg/types/types.go @@ -69,13 +69,14 @@ type NetConf struct { // RuntimeConfig specifies CNI RuntimeConfig type RuntimeConfig struct { - PortMaps []*PortMapEntry `json:"portMappings,omitempty"` - Bandwidth *BandwidthEntry `json:"bandwidth,omitempty"` - IPs []string `json:"ips,omitempty"` - Mac string `json:"mac,omitempty"` - InfinibandGUID string `json:"infinibandGUID,omitempty"` - DeviceID string `json:"deviceID,omitempty"` - CNIDeviceInfoFile string `json:"CNIDeviceInfoFile,omitempty"` + PortMaps []*PortMapEntry `json:"portMappings,omitempty"` + Bandwidth *BandwidthEntry `json:"bandwidth,omitempty"` + IPs []string `json:"ips,omitempty"` + Mac string `json:"mac,omitempty"` + InfinibandGUID string `json:"infinibandGUID,omitempty"` + DeviceID string `json:"deviceID,omitempty"` + CNIDeviceInfoFile string `json:"CNIDeviceInfoFile,omitempty"` + PodAnnotations *map[string]string `json:"io.kubernetes.cri.pod-annotations,omitempty"` } // PortMapEntry for CNI PortMapEntry