diff options
author | Andrew Aylett <andrew@aylett.co.uk> | 2022-04-02 20:35:12 +0100 |
---|---|---|
committer | Andrew Aylett <andrew@aylett.co.uk> | 2022-04-02 21:10:40 +0100 |
commit | bf4318e60697c0d38b520ff79fd85f45e18b1309 (patch) | |
tree | a7805ca7b53458d71c85411709d6f62217d60c0f /pkg/specgenutil | |
parent | d4394ea3688ad1942b8457f6df869f7c440d49e7 (diff) | |
download | podman-bf4318e60697c0d38b520ff79fd85f45e18b1309.tar.gz podman-bf4318e60697c0d38b520ff79fd85f45e18b1309.tar.bz2 podman-bf4318e60697c0d38b520ff79fd85f45e18b1309.zip |
Allow creating anonymous volumes with --mount
This fixes #13756.
All the mechanics to create anonymous volumes is already present, but
there's still a validation preventing that path from being taken. We
remove the validation, which allows the volume to be created
successfully.
Signed-off-by: Andrew Aylett <andrew@aylett.co.uk>
Diffstat (limited to 'pkg/specgenutil')
-rw-r--r-- | pkg/specgenutil/volumes.go | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/pkg/specgenutil/volumes.go b/pkg/specgenutil/volumes.go index dd7eed2fd..8a861077a 100644 --- a/pkg/specgenutil/volumes.go +++ b/pkg/specgenutil/volumes.go @@ -518,7 +518,7 @@ func getDevptsMount(args []string) (spec.Mount, error) { func getNamedVolume(args []string) (*specgen.NamedVolume, error) { newVolume := new(specgen.NamedVolume) - var setSource, setDest, setRORW, setSuid, setDev, setExec, setOwnership bool + var setDest, setRORW, setSuid, setDev, setExec, setOwnership bool for _, val := range args { kv := strings.SplitN(val, "=", 2) @@ -554,7 +554,6 @@ func getNamedVolume(args []string) (*specgen.NamedVolume, error) { return nil, errors.Wrapf(optionArgError, kv[0]) } newVolume.Name = kv[1] - setSource = true case "target", "dst", "destination": if len(kv) == 1 { return nil, errors.Wrapf(optionArgError, kv[0]) @@ -585,9 +584,6 @@ func getNamedVolume(args []string) (*specgen.NamedVolume, error) { } } - if !setSource { - return nil, errors.Errorf("must set source volume") - } if !setDest { return nil, noDestError } |