Merge pull request #4103 from mheon/handle_volume_conflict
Handle conflict between volumes and --read-only-tmpfs
This commit is contained in:
commit
525be7d3db
|
@ -168,6 +168,9 @@ func (config *CreateConfig) parseVolumes(runtime *libpod.Runtime) ([]spec.Mount,
|
|||
if _, ok := baseMounts[dest]; ok {
|
||||
continue
|
||||
}
|
||||
if _, ok := baseVolumes[dest]; ok {
|
||||
continue
|
||||
}
|
||||
localOpts := options
|
||||
if dest == "/run" {
|
||||
localOpts = append(localOpts, "noexec", "size=65536k")
|
||||
|
|
|
@ -270,4 +270,14 @@ var _ = Describe("Podman run with volumes", func() {
|
|||
Expect(separateVolumeSession.ExitCode()).To(Equal(0))
|
||||
Expect(separateVolumeSession.OutputToString()).To(Equal(baselineOutput))
|
||||
})
|
||||
|
||||
It("podman read-only tmpfs conflict with volume", func() {
|
||||
session := podmanTest.Podman([]string{"run", "--rm", "-t", "-i", "--read-only", "-v", "tmp_volume:/run", ALPINE, "touch", "/run/a"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session.ExitCode()).To(Equal(0))
|
||||
|
||||
session2 := podmanTest.Podman([]string{"run", "--rm", "-t", "-i", "--read-only", "--tmpfs", "/run", ALPINE, "touch", "/run/a"})
|
||||
session2.WaitWithDefaultTimeout()
|
||||
Expect(session2.ExitCode()).To(Equal(0))
|
||||
})
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue