From 624d13d8da12dd7ac0a916c4c5041072eba24cb3 Mon Sep 17 00:00:00 2001 From: Archana Shinde Date: Thu, 25 Jun 2020 01:44:23 -0700 Subject: [PATCH 1/2] shimv2 : Remove workaround for sharedPidNs Removing code that existed as a workaround for a bug in how shared process namespaces were handled in the agent. That has been long fixed in the agent. With this, sharedPidNs will now work with shimv2. Fixes #2788 Signed-off-by: Archana Shinde --- containerd-shim-v2/create.go | 8 -------- 1 file changed, 8 deletions(-) diff --git a/containerd-shim-v2/create.go b/containerd-shim-v2/create.go index affdbae2b4..1e8989aa46 100644 --- a/containerd-shim-v2/create.go +++ b/containerd-shim-v2/create.go @@ -132,14 +132,6 @@ func loadSpec(r *taskAPI.CreateTaskRequest) (*specs.Spec, string, error) { return nil, "", err } - // Todo: - // Since there is a bug in kata for sharedPidNs, here to - // remove the pidns to disable the sharePidNs temporarily, - // once kata fixed this issue, we can remove this line. - // For the bug, please see: - // https://github.com/kata-containers/runtime/issues/930 - removeNamespace(&ociSpec, specs.PIDNamespace) - return &ociSpec, bundlePath, nil } From e0dc806ae1348d5ef543acccb3e7079e43aca1a0 Mon Sep 17 00:00:00 2001 From: Archana Shinde Date: Thu, 25 Jun 2020 14:59:21 -0700 Subject: [PATCH 2/2] shimv2: Removing function as no longer used Function removeNamespace is no longer used. Get rid of it. Signed-off-by: Archana Shinde --- containerd-shim-v2/utils.go | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/containerd-shim-v2/utils.go b/containerd-shim-v2/utils.go index cebac177b3..ff6b402345 100644 --- a/containerd-shim-v2/utils.go +++ b/containerd-shim-v2/utils.go @@ -19,7 +19,6 @@ import ( vc "github.com/kata-containers/runtime/virtcontainers" "github.com/kata-containers/runtime/virtcontainers/pkg/compatoci" "github.com/kata-containers/runtime/virtcontainers/pkg/oci" - "github.com/opencontainers/runtime-spec/specs-go" "github.com/sirupsen/logrus" ) @@ -124,12 +123,3 @@ func noNeedForOutput(detach bool, tty bool) bool { return true } - -func removeNamespace(s *specs.Spec, nsType specs.LinuxNamespaceType) { - for i, n := range s.Linux.Namespaces { - if n.Type == nsType { - s.Linux.Namespaces = append(s.Linux.Namespaces[:i], s.Linux.Namespaces[i+1:]...) - return - } - } -}