diff --git a/pkg/cri/annotations/annotations.go b/pkg/cri/annotations/annotations.go index b69f136a8..68a0f4837 100644 --- a/pkg/cri/annotations/annotations.go +++ b/pkg/cri/annotations/annotations.go @@ -53,6 +53,10 @@ const ( // ContainerName is the name of the container in the pod ContainerName = "io.kubernetes.cri.container-name" + // ImageName is the name of the image used to create the container ImageName = "io.kubernetes.cri.image-name" + + // PodAnnotations are the annotations of the pod + PodAnnotations = "io.kubernetes.cri.pod-annotations" ) diff --git a/pkg/cri/server/sandbox_run.go b/pkg/cri/server/sandbox_run.go index 39ded4966..0ae6466ac 100644 --- a/pkg/cri/server/sandbox_run.go +++ b/pkg/cri/server/sandbox_run.go @@ -370,6 +370,7 @@ func (c *criService) setupPodNetwork(ctx context.Context, sandbox *sandboxstore. func cniNamespaceOpts(id string, config *runtime.PodSandboxConfig) ([]cni.NamespaceOpts, error) { opts := []cni.NamespaceOpts{ cni.WithLabels(toCNILabels(id, config)), + cni.WithCapability(annotations.PodAnnotations, config.Annotations), } portMappings := toCNIPortMappings(config.GetPortMappings())