cri: add annotations for pod name and namespace
cri-o has annotations for pod name, namespace and container name:
https://github.com/containers/podman/blob/master/pkg/annotations/annotations.go
But so far containerd had only the container name.
This patch will be useful for seccomp agents to have a different
behaviour depending on the pod (see runtime-spec PR 1074 and runc PR
2682). This should simplify the code in:
b2d423695d/pkg/kuberesolver/kuberesolver.go (L16-L27)
Signed-off-by: Alban Crequy <alban@kinvolk.io>
			
			
This commit is contained in:
		| @@ -106,6 +106,8 @@ func (c *criService) containerSpec(id string, sandboxID string, sandboxPid uint3 | ||||
| 	specOpts = append(specOpts, | ||||
| 		customopts.WithAnnotation(annotations.ContainerType, annotations.ContainerTypeContainer), | ||||
| 		customopts.WithAnnotation(annotations.SandboxID, sandboxID), | ||||
| 		customopts.WithAnnotation(annotations.SandboxNamespace, sandboxConfig.GetMetadata().GetNamespace()), | ||||
| 		customopts.WithAnnotation(annotations.SandboxName, sandboxConfig.GetMetadata().GetName()), | ||||
| 		customopts.WithAnnotation(annotations.ContainerName, containerName), | ||||
| 	) | ||||
| 	return c.runtimeSpec(id, ociRuntime.BaseRuntimeSpec, specOpts...) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Alban Crequy
					Alban Crequy