diff options
author | Giuseppe Scrivano <gscrivan@redhat.com> | 2022-06-27 20:22:11 +0200 |
---|---|---|
committer | Giuseppe Scrivano <gscrivan@redhat.com> | 2022-06-27 20:22:20 +0200 |
commit | 28e2a604b472b3b3daea31d10da007dfac10b028 (patch) | |
tree | 90b75590172ddd4957244cb9eab52580011fc3c1 /vendor/github.com | |
parent | c29c6adf968945461d090f2cafe68a3341817c0d (diff) | |
download | podman-28e2a604b472b3b3daea31d10da007dfac10b028.tar.gz podman-28e2a604b472b3b3daea31d10da007dfac10b028.tar.bz2 podman-28e2a604b472b3b3daea31d10da007dfac10b028.zip |
vendor: update containers/common
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Diffstat (limited to 'vendor/github.com')
-rw-r--r-- | vendor/github.com/containers/common/pkg/parse/parse.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/vendor/github.com/containers/common/pkg/parse/parse.go b/vendor/github.com/containers/common/pkg/parse/parse.go index 6c4958cc2..43b783e0c 100644 --- a/vendor/github.com/containers/common/pkg/parse/parse.go +++ b/vendor/github.com/containers/common/pkg/parse/parse.go @@ -14,7 +14,7 @@ import ( // ValidateVolumeOpts validates a volume's options func ValidateVolumeOpts(options []string) ([]string, error) { - var foundRootPropagation, foundRWRO, foundLabelChange, bindType, foundExec, foundDev, foundSuid, foundChown, foundUpperDir, foundWorkDir int + var foundRootPropagation, foundRWRO, foundLabelChange, bindType, foundExec, foundDev, foundSuid, foundChown, foundUpperDir, foundWorkDir, foundCopy int finalOpts := make([]string, 0, len(options)) for _, opt := range options { // support advanced options like upperdir=/path, workdir=/path @@ -88,6 +88,11 @@ func ValidateVolumeOpts(options []string) ([]string, error) { // are intended to be always safe to use, even not on OS // X). continue + case "copy", "nocopy": + foundCopy++ + if foundCopy > 1 { + return nil, errors.Errorf("invalid options %q, can only specify 1 'copy' or 'nocopy' option", strings.Join(options, ", ")) + } default: return nil, errors.Errorf("invalid option type %q", opt) } |