summaryrefslogtreecommitdiff
path: root/pkg/namespaces/namespaces.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2019-05-25 12:32:08 +0200
committerGitHub <noreply@github.com>2019-05-25 12:32:08 +0200
commitb1d590b4412fa7508390c8733c549049d6d3a75b (patch)
tree878e704e129d29e4c869717a97abde3ef5891e56 /pkg/namespaces/namespaces.go
parent3c85122faa8f5697d41cb704c76468349cf97cb8 (diff)
parent5eb321ac372f5c29f65769a4554ff224186ffb21 (diff)
downloadpodman-b1d590b4412fa7508390c8733c549049d6d3a75b.tar.gz
podman-b1d590b4412fa7508390c8733c549049d6d3a75b.tar.bz2
podman-b1d590b4412fa7508390c8733c549049d6d3a75b.zip
Merge pull request #3196 from giuseppe/keep-id
userns: add new option --userns=keep-id
Diffstat (limited to 'pkg/namespaces/namespaces.go')
-rw-r--r--pkg/namespaces/namespaces.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/pkg/namespaces/namespaces.go b/pkg/namespaces/namespaces.go
index fde6118af..ec9276344 100644
--- a/pkg/namespaces/namespaces.go
+++ b/pkg/namespaces/namespaces.go
@@ -12,6 +12,11 @@ func (n UsernsMode) IsHost() bool {
return n == "host"
}
+// IsKeepID indicates whether container uses a mapping where the (uid, gid) on the host is lept inside of the namespace.
+func (n UsernsMode) IsKeepID() bool {
+ return n == "keep-id"
+}
+
// IsPrivate indicates whether the container uses the a private userns.
func (n UsernsMode) IsPrivate() bool {
return !(n.IsHost())
@@ -21,7 +26,7 @@ func (n UsernsMode) IsPrivate() bool {
func (n UsernsMode) Valid() bool {
parts := strings.Split(string(n), ":")
switch mode := parts[0]; mode {
- case "", "host":
+ case "", "host", "keep-id":
default:
return false
}