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>
This commit is contained in:
Andrew Aylett
2022-04-02 20:35:12 +01:00
parent d4394ea368
commit bf4318e606
2 changed files with 8 additions and 5 deletions

View File

@@ -778,6 +778,13 @@ VOLUME /test/`, ALPINE)
Expect(session).Should(Exit(0))
Expect(session.OutputToString()).Should(Equal("888:888"))
// anonymous volume mount
vol = "type=volume," + "dst=" + dest
session = podmanTest.Podman([]string{"run", "--rm", "--user", "888:888", "--mount", vol, ALPINE, "stat", "-c", "%u:%g", dest})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session.OutputToString()).Should(Equal("888:888"))
// named volume mount
namedVolume := podmanTest.Podman([]string{"volume", "create", "foo"})
namedVolume.WaitWithDefaultTimeout()