diff --git a/pkg/ocicni/ocicni.go b/pkg/ocicni/ocicni.go index e4251f2a..2d56edda 100644 --- a/pkg/ocicni/ocicni.go +++ b/pkg/ocicni/ocicni.go @@ -864,6 +864,11 @@ func buildCNIRuntimeConf(podNetwork *PodNetwork, ifName string, runtimeConfig Ru rt.CapabilityArgs["cgroupPath"] = runtimeConfig.CgroupPath } + // Set PodAnnotations in Capabilities + if runtimeConfig.PodAnnotations != nil { + rt.CapabilityArgs["io.kubernetes.cri.pod-annotations"] = runtimeConfig.PodAnnotations + } + return rt, nil } diff --git a/pkg/ocicni/types.go b/pkg/ocicni/types.go index ff9c5c0c..a8486467 100644 --- a/pkg/ocicni/types.go +++ b/pkg/ocicni/types.go @@ -58,6 +58,8 @@ type RuntimeConfig struct { // CgroupPath is the path to the pod's cgroup // e.g. "/kubelet.slice/kubelet-kubepods.slice/kubelet-kubepods-burstable.slice/kubelet-kubepods-burstable-pod28ce45bc_63f8_48a3_a99b_cfb9e63c856c.slice" CgroupPath string + // PodAnnotations are the annotations of the pod. + PodAnnotations *map[string]string `json:"io.kubernetes.cri.pod-annotations,omitempty"` } // BandwidthConfig maps to the standard CNI bandwidth Capability