mirror of
https://github.com/k8snetworkplumbingwg/multus-cni.git
synced 2025-08-28 04:43:11 +00:00
pass through the pod annotations when multus receives them
See https://github.com/kubernetes/kubernetes/issues/69882\#issuecomment-1509077177 Passing the annotations seems not to be a standardized behaviour, but it is very useful nontheless. Signed-off-by: Philipp Riederer <priederer@genesiscloud.com>
This commit is contained in:
parent
003fbd5785
commit
7ad9d7a04a
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user