mirror of
https://github.com/containers/podman.git
synced 2026-03-13 08:01:19 +08:00
Merge pull request #28197 from TomSweeneyRedHat/dev/tsweeney/accel-596-v4.9-rhel
[v4.9-rhel] Fix: Remove appending rw as the default mount option
This commit is contained in:
@@ -175,9 +175,6 @@ func ProcessOptions(options []string, isTmpfs bool, sourcePath string) ([]string
|
||||
newOptions = append(newOptions, opt)
|
||||
}
|
||||
|
||||
if !foundWrite {
|
||||
newOptions = append(newOptions, "rw")
|
||||
}
|
||||
if !foundProp {
|
||||
newOptions = append(newOptions, "rprivate")
|
||||
}
|
||||
|
||||
@@ -5896,7 +5896,7 @@ spec:
|
||||
inspectCtr2 := podmanTest.Podman([]string{"inspect", "-f", "'{{ .HostConfig.Binds }}'", ctrNameInKubePod})
|
||||
inspectCtr2.WaitWithDefaultTimeout()
|
||||
Expect(inspectCtr2).Should(ExitCleanly())
|
||||
Expect(inspectCtr2.OutputToString()).To(ContainSubstring(":" + vol1 + ":rw"))
|
||||
Expect(inspectCtr2.OutputToString()).To(ContainSubstring(":" + vol1))
|
||||
|
||||
inspectCtr1 := podmanTest.Podman([]string{"inspect", "-f", "'{{ .HostConfig.Binds }}'", ctr1})
|
||||
inspectCtr1.WaitWithDefaultTimeout()
|
||||
|
||||
@@ -259,7 +259,7 @@ class TestContainers(common.DockerTestCase):
|
||||
has_tried_pull = True
|
||||
self.assertFalse(has_tried_pull, "the build process has tried tried to pull the base image")
|
||||
|
||||
def test_mount_rw_by_default(self):
|
||||
def test_mount_options_by_default(self):
|
||||
ctr: Optional[Container] = None
|
||||
vol: Optional[Volume] = None
|
||||
|
||||
@@ -276,7 +276,7 @@ class TestContainers(common.DockerTestCase):
|
||||
ctr_inspect = self.docker.api.inspect_container(ctr.id)
|
||||
binds: List[str] = ctr_inspect["HostConfig"]["Binds"]
|
||||
self.assertEqual(len(binds), 1)
|
||||
self.assertEqual(binds[0], "test-volume:/vol-mnt:rw,rprivate,nosuid,nodev,rbind")
|
||||
self.assertEqual(binds[0], "test-volume:/vol-mnt:rprivate,nosuid,nodev,rbind")
|
||||
finally:
|
||||
if ctr is not None:
|
||||
ctr.remove()
|
||||
|
||||
@@ -845,7 +845,7 @@ EOF
|
||||
service_setup $QUADLET_SERVICE_NAME
|
||||
|
||||
run_podman container inspect --format '{{index .HostConfig.Tmpfs "/tmpfs1"}}' $QUADLET_CONTAINER_NAME
|
||||
is "$output" "rw,rprivate,nosuid,nodev,tmpcopyup" "regular tmpfs mount"
|
||||
is "$output" "rprivate,nosuid,nodev,tmpcopyup" "regular tmpfs mount"
|
||||
|
||||
run_podman container inspect --format '{{index .HostConfig.Tmpfs "/tmpfs2"}}' $QUADLET_CONTAINER_NAME
|
||||
is "$output" "ro,rprivate,nosuid,nodev,tmpcopyup" "read-only tmpfs mount"
|
||||
|
||||
Reference in New Issue
Block a user