aboutsummaryrefslogtreecommitdiff
path: root/pkg/util/mountOpts.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-02-23 10:11:28 -0500
committerGitHub <noreply@github.com>2021-02-23 10:11:28 -0500
commit1702cbc6917f431bcc65d6c5bdc6fcf99231977a (patch)
tree2b138dda345970e5898593162c38e10d4909fabd /pkg/util/mountOpts.go
parent96fc9d983e0fc5bae48c3cec3acce86cdb6e1059 (diff)
parent874f2327e6ca963edda7cc46819d51048d3d19a8 (diff)
downloadpodman-1702cbc6917f431bcc65d6c5bdc6fcf99231977a.tar.gz
podman-1702cbc6917f431bcc65d6c5bdc6fcf99231977a.tar.bz2
podman-1702cbc6917f431bcc65d6c5bdc6fcf99231977a.zip
Merge pull request #8349 from EduardoVega/7778-chowning-based-on-uid
Add U volume flag to chown source volumes
Diffstat (limited to 'pkg/util/mountOpts.go')
-rw-r--r--pkg/util/mountOpts.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/pkg/util/mountOpts.go b/pkg/util/mountOpts.go
index b3a38f286..f13dc94ec 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 bool
+ foundWrite, foundSize, foundProp, foundMode, foundExec, foundSuid, foundDev, foundCopyUp, foundBind, foundZ, foundU bool
)
newOptions := make([]string, 0, len(options))
@@ -116,6 +116,11 @@ func ProcessOptions(options []string, isTmpfs bool, sourcePath string) ([]string
return nil, errors.Wrapf(ErrDupeMntOption, "only one of 'z' and 'Z' can be used")
}
foundZ = true
+ case "U":
+ if foundU {
+ return nil, errors.Wrapf(ErrDupeMntOption, "the 'U' option can only be set once")
+ }
+ foundU = true
default:
return nil, errors.Wrapf(ErrBadMntOption, "unknown mount option %q", opt)
}