diff options
author | Matthew Heon <matthew.heon@pm.me> | 2020-07-06 12:56:52 -0400 |
---|---|---|
committer | Matthew Heon <matthew.heon@pm.me> | 2020-07-06 16:59:05 -0400 |
commit | 8ab0abbb06b310707eee0a5ece0f9fb0bac8d234 (patch) | |
tree | 6a7d8e606263e9ec2b78ec50c3a8f379e9dc1d33 /cmd | |
parent | e3e2b1e65930bfc40c5b60802c4d6ea175169732 (diff) | |
download | podman-8ab0abbb06b310707eee0a5ece0f9fb0bac8d234.tar.gz podman-8ab0abbb06b310707eee0a5ece0f9fb0bac8d234.tar.bz2 podman-8ab0abbb06b310707eee0a5ece0f9fb0bac8d234.zip |
Fix bug where `podman mount` didn't error as rootless
We require that rootless `podman mount` be run inside a shell
spawned by `podman unshare` (which gives us a mount namespace
which actually lets other commands use the mounted filesystem).
The fix is simple - we need to mark the command as requiring the
rootless user namespace not be configured, so we can test for it
later as part of the mount code and error if we needed to make
one.
Disable rootless tests as part of this - they were never expected
to work.
Fixes #6856
Signed-off-by: Matthew Heon <matthew.heon@pm.me>
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/podman/containers/mount.go | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/cmd/podman/containers/mount.go b/cmd/podman/containers/mount.go index 44af27801..37ee92177 100644 --- a/cmd/podman/containers/mount.go +++ b/cmd/podman/containers/mount.go @@ -30,13 +30,18 @@ var ( Args: func(cmd *cobra.Command, args []string) error { return validate.CheckAllLatestAndCIDFile(cmd, args, true, false) }, + Annotations: map[string]string{ + registry.ParentNSRequired: "", + }, } containerMountCommmand = &cobra.Command{ - Use: mountCommand.Use, - Short: mountCommand.Short, - Long: mountCommand.Long, - RunE: mountCommand.RunE, + Use: mountCommand.Use, + Short: mountCommand.Short, + Long: mountCommand.Long, + RunE: mountCommand.RunE, + Args: mountCommand.Args, + Annotations: mountCommand.Annotations, } ) |