diff --git a/server/container.go b/server/container.go index 0107c118..b8b43ae7 100644 --- a/server/container.go +++ b/server/container.go @@ -6,6 +6,13 @@ import ( "github.com/kubernetes-incubator/cri-o/oci" ) +const ( + // containerTypeSandbox represents a pod sandbox container + containerTypeSandbox = "sandbox" + // containerTypeContainer represents a container running within a pod + containerTypeContainer = "container" +) + type containerRequest interface { GetContainerId() string } diff --git a/server/container_create.go b/server/container_create.go index b7b8d154..9e8e1624 100644 --- a/server/container_create.go +++ b/server/container_create.go @@ -275,6 +275,8 @@ func (s *Server) createSandboxContainer(containerID string, containerName string specgen.AddAnnotation("ocid/name", containerName) specgen.AddAnnotation("ocid/sandbox_id", sb.id) + specgen.AddAnnotation("ocid/sandbox_name", sb.infraContainer.Name()) + specgen.AddAnnotation("ocid/container_type", containerTypeContainer) specgen.AddAnnotation("ocid/log_path", logPath) specgen.AddAnnotation("ocid/tty", fmt.Sprintf("%v", containerConfig.GetTty())) diff --git a/server/sandbox_run.go b/server/sandbox_run.go index 891bace8..f776476d 100644 --- a/server/sandbox_run.go +++ b/server/sandbox_run.go @@ -167,6 +167,7 @@ func (s *Server) RunPodSandbox(ctx context.Context, req *pb.RunPodSandboxRequest g.AddAnnotation("ocid/annotations", string(annotationsJSON)) g.AddAnnotation("ocid/log_path", logDir) g.AddAnnotation("ocid/name", name) + g.AddAnnotation("ocid/container_type", containerTypeSandbox) g.AddAnnotation("ocid/container_name", containerName) g.AddAnnotation("ocid/container_id", containerID)