From 0e6266858a913ac36de0726ede10d5d03af533e3 Mon Sep 17 00:00:00 2001 From: haircommander Date: Mon, 20 Aug 2018 17:56:35 -0400 Subject: Fixing network ns segfault As well as small style corrections, update pod_top_test to use CreatePod, and move handling of adding a container to the pod's namespace from container_internal_linux to libpod/option. Signed-off-by: haircommander Closes: #1187 Approved by: mheon --- pkg/spec/parse.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'pkg/spec/parse.go') diff --git a/pkg/spec/parse.go b/pkg/spec/parse.go index 4cdc62de6..dc4f50a3e 100644 --- a/pkg/spec/parse.go +++ b/pkg/spec/parse.go @@ -8,6 +8,10 @@ import ( "github.com/docker/go-units" ) +// POD signifies a kernel namespace is being shared +// by a container with the pod it is associated with +const POD = "pod" + // weightDevice is a structure that holds device:weight pair type weightDevice struct { path string @@ -32,7 +36,7 @@ func IsNS(s string) bool { // IsPod returns if the specified string is pod func IsPod(s string) bool { - return s == "pod" + return s == POD } // Valid checks the validity of a linux namespace -- cgit v1.2.3-54-g00ecf