summaryrefslogtreecommitdiff
path: root/pkg
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2022-02-09 14:53:52 -0500
committerGitHub <noreply@github.com>2022-02-09 14:53:52 -0500
commit5b2d96fc29c17253e3ddd0e18ce5f71710b83658 (patch)
tree22fdba98896a06247f82a7a9de74909e4b120e45 /pkg
parent2dca7b25d8af3285fa6c5bec7f32523a32a0d411 (diff)
parent7499496f3ded8e46c3b4a4918feb02079eea9e51 (diff)
downloadpodman-5b2d96fc29c17253e3ddd0e18ce5f71710b83658.tar.gz
podman-5b2d96fc29c17253e3ddd0e18ce5f71710b83658.tar.bz2
podman-5b2d96fc29c17253e3ddd0e18ce5f71710b83658.zip
Merge pull request #13177 from rhatdan/v4.0
[4.0] idmap should be able to be specified along with other options
Diffstat (limited to 'pkg')
-rw-r--r--pkg/util/mountOpts.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/pkg/util/mountOpts.go b/pkg/util/mountOpts.go
index f32cf6ea6..d8b14c0df 100644
--- a/pkg/util/mountOpts.go
+++ b/pkg/util/mountOpts.go
@@ -25,7 +25,7 @@ type defaultMountOptions struct {
// The sourcePath variable, if not empty, contains a bind mount source.
func ProcessOptions(options []string, isTmpfs bool, sourcePath string) ([]string, error) {
var (
- foundWrite, foundSize, foundProp, foundMode, foundExec, foundSuid, foundDev, foundCopyUp, foundBind, foundZ, foundU, foundOverlay bool
+ foundWrite, foundSize, foundProp, foundMode, foundExec, foundSuid, foundDev, foundCopyUp, foundBind, foundZ, foundU, foundOverlay, foundIdmap bool
)
newOptions := make([]string, 0, len(options))
@@ -49,9 +49,10 @@ func ProcessOptions(options []string, isTmpfs bool, sourcePath string) ([]string
case "O":
foundOverlay = true
case "idmap":
- if len(options) > 1 {
- return nil, errors.Wrapf(ErrDupeMntOption, "'O' option can not be used with other options")
+ if foundIdmap {
+ return nil, errors.Wrapf(ErrDupeMntOption, "the 'idmap' option can only be set once")
}
+ foundIdmap = true
case "exec", "noexec":
if foundExec {
return nil, errors.Wrapf(ErrDupeMntOption, "only one of 'noexec' and 'exec' can be used")