diff options
author | openshift-ci[bot] <75433959+openshift-ci[bot]@users.noreply.github.com> | 2022-06-28 13:57:16 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-28 13:57:16 +0000 |
commit | 8267cd3c514ed1e8f41a7e4b6017f11400f134aa (patch) | |
tree | 19f30756ceda7e152ef3cdefaf5627b746e2a403 /pkg/util | |
parent | 9c5d97b5c5b583fc3b3c8af52bf3e1b6a5c2cb90 (diff) | |
parent | aada13f244d52dad9b6a1cfaa725e9d36d75a858 (diff) | |
download | podman-8267cd3c514ed1e8f41a7e4b6017f11400f134aa.tar.gz podman-8267cd3c514ed1e8f41a7e4b6017f11400f134aa.tar.bz2 podman-8267cd3c514ed1e8f41a7e4b6017f11400f134aa.zip |
Merge pull request #14734 from giuseppe/copyup-switch-order
volume: add two new options copy and nocopy
Diffstat (limited to 'pkg/util')
-rw-r--r-- | pkg/util/mountOpts.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/pkg/util/mountOpts.go b/pkg/util/mountOpts.go index e37394619..d1dd75a82 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, foundIdmap bool + foundWrite, foundSize, foundProp, foundMode, foundExec, foundSuid, foundDev, foundCopyUp, foundBind, foundZ, foundU, foundOverlay, foundIdmap, foundCopy bool ) newOptions := make([]string, 0, len(options)) @@ -55,6 +55,11 @@ func ProcessOptions(options []string, isTmpfs bool, sourcePath string) ([]string } switch splitOpt[0] { + case "copy", "nocopy": + if foundCopy { + return nil, errors.Wrapf(ErrDupeMntOption, "only one of 'nocopy' and 'copy' can be used") + } + foundCopy = true case "O": foundOverlay = true case "volume-opt": |