Skip to content

Commit 806722b

Browse files
committed
specgenutil: Fix parsing of mount option ptmxmode
Fix typo: ptxmode -> ptmxmode Reference: #24921 Signed-off-by: Erik Sjölund <[email protected]>
1 parent e2e40b4 commit 806722b

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

pkg/specgenutil/volumes.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,7 @@ func getDevptsMount(args []string) (spec.Mount, error) {
560560
for _, arg := range args {
561561
name, value, hasValue := strings.Cut(arg, "=")
562562
switch name {
563-
case "uid", "gid", "mode", "ptxmode", "newinstance", "max":
563+
case "uid", "gid", "mode", "ptmxmode", "newinstance", "max":
564564
newMount.Options = append(newMount.Options, arg)
565565
case "target", "dst", "destination":
566566
if !hasValue {

test/e2e/run_test.go

+7
Original file line numberDiff line numberDiff line change
@@ -1406,6 +1406,13 @@ VOLUME %s`, ALPINE, volPath, volPath)
14061406
Expect(session.OutputToString()).To(ContainSubstring("1001-123"))
14071407
})
14081408

1409+
It("podman run --mount type=devpts,target=/dev/pts with ptmxmode", func() {
1410+
session := podmanTest.Podman([]string{"run", "--mount", "type=devpts,target=/dev/pts,ptmxmode=0444", fedoraMinimal, "findmnt", "-noOPTIONS", "/dev/pts"})
1411+
session.WaitWithDefaultTimeout()
1412+
Expect(session).Should(ExitCleanly())
1413+
Expect(session.OutputToString()).To(ContainSubstring("ptmxmode=444"))
1414+
})
1415+
14091416
It("podman run --pod automatically", func() {
14101417
session := podmanTest.Podman([]string{"run", "-d", "--pod", "new:foobar", ALPINE, "nc", "-l", "-p", "8686"})
14111418
session.WaitWithDefaultTimeout()

0 commit comments

Comments
 (0)