diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2022-04-22 08:40:34 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-22 08:40:34 -0400 |
commit | 1bafde2d226067257d430c367ec2c53208d3eeeb (patch) | |
tree | 9d5fb9b77482e7c1284eef11c18a83927dc91da8 /pkg/namespaces/namespaces.go | |
parent | 22500d797aba09eada894a69ad88f2699a560d02 (diff) | |
parent | 80c0fceb24b70a85f3f2ca8be29f4a131c0881d4 (diff) | |
download | podman-1bafde2d226067257d430c367ec2c53208d3eeeb.tar.gz podman-1bafde2d226067257d430c367ec2c53208d3eeeb.tar.bz2 podman-1bafde2d226067257d430c367ec2c53208d3eeeb.zip |
Merge pull request #13881 from rhatdan/userns
Add support for --userns=nomap
Diffstat (limited to 'pkg/namespaces/namespaces.go')
-rw-r--r-- | pkg/namespaces/namespaces.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/pkg/namespaces/namespaces.go b/pkg/namespaces/namespaces.go index a264a5a0f..bdea7c310 100644 --- a/pkg/namespaces/namespaces.go +++ b/pkg/namespaces/namespaces.go @@ -96,6 +96,11 @@ func (n UsernsMode) IsKeepID() bool { return n == "keep-id" } +// IsNoMap indicates whether container uses a mapping where the (uid, gid) on the host is not present in the namespace. +func (n UsernsMode) IsNoMap() bool { + return n == "nomap" +} + // IsAuto indicates whether container uses the "auto" userns mode. func (n UsernsMode) IsAuto() bool { parts := strings.Split(string(n), ":") @@ -158,7 +163,7 @@ func (n UsernsMode) IsPrivate() bool { func (n UsernsMode) Valid() bool { parts := strings.Split(string(n), ":") switch mode := parts[0]; mode { - case "", privateType, hostType, "keep-id", nsType, "auto": + case "", privateType, hostType, "keep-id", nsType, "auto", "nomap": case containerType: if len(parts) != 2 || parts[1] == "" { return false |