Merge pull request #5026 from crosbymichael/cni-anno
[cri] add pod annotations to CNI call
This commit is contained in:
commit
e288feacf3
@ -53,6 +53,10 @@ const (
|
|||||||
|
|
||||||
// ContainerName is the name of the container in the pod
|
// ContainerName is the name of the container in the pod
|
||||||
ContainerName = "io.kubernetes.cri.container-name"
|
ContainerName = "io.kubernetes.cri.container-name"
|
||||||
|
|
||||||
// ImageName is the name of the image used to create the container
|
// ImageName is the name of the image used to create the container
|
||||||
ImageName = "io.kubernetes.cri.image-name"
|
ImageName = "io.kubernetes.cri.image-name"
|
||||||
|
|
||||||
|
// PodAnnotations are the annotations of the pod
|
||||||
|
PodAnnotations = "io.kubernetes.cri.pod-annotations"
|
||||||
)
|
)
|
||||||
|
@ -370,6 +370,7 @@ func (c *criService) setupPodNetwork(ctx context.Context, sandbox *sandboxstore.
|
|||||||
func cniNamespaceOpts(id string, config *runtime.PodSandboxConfig) ([]cni.NamespaceOpts, error) {
|
func cniNamespaceOpts(id string, config *runtime.PodSandboxConfig) ([]cni.NamespaceOpts, error) {
|
||||||
opts := []cni.NamespaceOpts{
|
opts := []cni.NamespaceOpts{
|
||||||
cni.WithLabels(toCNILabels(id, config)),
|
cni.WithLabels(toCNILabels(id, config)),
|
||||||
|
cni.WithCapability(annotations.PodAnnotations, config.Annotations),
|
||||||
}
|
}
|
||||||
|
|
||||||
portMappings := toCNIPortMappings(config.GetPortMappings())
|
portMappings := toCNIPortMappings(config.GetPortMappings())
|
||||||
|
Loading…
Reference in New Issue
Block a user