summaryrefslogtreecommitdiff
path: root/pkg/specgen/namespaces.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-04-24 22:39:26 +0200
committerGitHub <noreply@github.com>2020-04-24 22:39:26 +0200
commit2afe579c064923841a55d57458fac4d91bec8173 (patch)
tree698f40ce419698c30cf8969b9438b3aa395f8434 /pkg/specgen/namespaces.go
parent10f3a8ac6bd9028f1c70ad48a7ebf2b2e33f2d6e (diff)
parent88f1994ab9a0bf3a8df3c8f74a39cd1db27c2070 (diff)
downloadpodman-2afe579c064923841a55d57458fac4d91bec8173.tar.gz
podman-2afe579c064923841a55d57458fac4d91bec8173.tar.bz2
podman-2afe579c064923841a55d57458fac4d91bec8173.zip
Merge pull request #5971 from giuseppe/fix-userns-tests
v2, podman: fix and enable all run_userns_test.go tests
Diffstat (limited to 'pkg/specgen/namespaces.go')
-rw-r--r--pkg/specgen/namespaces.go14
1 files changed, 12 insertions, 2 deletions
diff --git a/pkg/specgen/namespaces.go b/pkg/specgen/namespaces.go
index fffbd6d9e..cee49ff51 100644
--- a/pkg/specgen/namespaces.go
+++ b/pkg/specgen/namespaces.go
@@ -76,6 +76,17 @@ func (n *Namespace) IsPod() bool {
func (n *Namespace) IsPrivate() bool {
return n.NSMode == Private
}
+
+// IsAuto indicates the namespace is auto
+func (n *Namespace) IsAuto() bool {
+ return n.NSMode == Auto
+}
+
+// IsKeepID indicates the namespace is KeepID
+func (n *Namespace) IsKeepID() bool {
+ return n.NSMode == KeepID
+}
+
func validateUserNS(n *Namespace) error {
if n == nil {
return nil
@@ -186,12 +197,11 @@ func ParseUserNamespace(ns string) (Namespace, error) {
if len(split) != 2 {
return toReturn, errors.Errorf("invalid setting for auto: mode")
}
- toReturn.NSMode = KeepID
+ toReturn.NSMode = Auto
toReturn.Value = split[1]
return toReturn, nil
case ns == "keep-id":
toReturn.NSMode = KeepID
- toReturn.NSMode = FromContainer
return toReturn, nil
}
return ParseNamespace(ns)