Skip to content

Commit

Permalink
Merge pull request #166 from sohankunkerkar/add-pod-annotations
Browse files Browse the repository at this point in the history
pkg/ocicni: add PodAnnotations to RuntimeConfig
  • Loading branch information
openshift-merge-robot authored Jul 10, 2023
2 parents f2749dc + fdbe875 commit eb8155a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/ocicni/ocicni.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
2 changes: 2 additions & 0 deletions pkg/ocicni/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit eb8155a

Please # to comment.