mirror of
https://github.com/containers/podman.git
synced 2025-08-06 19:44:14 +08:00
Merge pull request #9415 from mheon/fix_9354
Change source path resolution for volume copy-up
This commit is contained in:
@ -1644,7 +1644,7 @@ func (c *Container) mountNamedVolume(v *ContainerNamedVolume, mountpoint string)
|
|||||||
getOptions := copier.GetOptions{
|
getOptions := copier.GetOptions{
|
||||||
KeepDirectoryNames: false,
|
KeepDirectoryNames: false,
|
||||||
}
|
}
|
||||||
errChan <- copier.Get(mountpoint, "", getOptions, []string{v.Dest + "/."}, writer)
|
errChan <- copier.Get(srcDir, "", getOptions, []string{"/."}, writer)
|
||||||
}()
|
}()
|
||||||
|
|
||||||
// Copy, volume side: stream what we've written to the pipe, into
|
// Copy, volume side: stream what we've written to the pipe, into
|
||||||
|
@ -334,6 +334,18 @@ RUN sh -c "cd /etc/apk && ln -s ../../testfile"`
|
|||||||
Expect(outputSession.OutputToString()).To(Equal(baselineOutput))
|
Expect(outputSession.OutputToString()).To(Equal(baselineOutput))
|
||||||
})
|
})
|
||||||
|
|
||||||
|
It("podman named volume copyup of /var", func() {
|
||||||
|
baselineSession := podmanTest.Podman([]string{"run", "--rm", "-t", "-i", fedoraMinimal, "ls", "/var"})
|
||||||
|
baselineSession.WaitWithDefaultTimeout()
|
||||||
|
Expect(baselineSession.ExitCode()).To(Equal(0))
|
||||||
|
baselineOutput := baselineSession.OutputToString()
|
||||||
|
|
||||||
|
outputSession := podmanTest.Podman([]string{"run", "-t", "-i", "-v", "/var", fedoraMinimal, "ls", "/var"})
|
||||||
|
outputSession.WaitWithDefaultTimeout()
|
||||||
|
Expect(outputSession.ExitCode()).To(Equal(0))
|
||||||
|
Expect(outputSession.OutputToString()).To(Equal(baselineOutput))
|
||||||
|
})
|
||||||
|
|
||||||
It("podman read-only tmpfs conflict with volume", func() {
|
It("podman read-only tmpfs conflict with volume", func() {
|
||||||
session := podmanTest.Podman([]string{"run", "--rm", "-t", "-i", "--read-only", "-v", "tmp_volume:" + dest, ALPINE, "touch", dest + "/a"})
|
session := podmanTest.Podman([]string{"run", "--rm", "-t", "-i", "--read-only", "-v", "tmp_volume:" + dest, ALPINE, "touch", dest + "/a"})
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
|
Reference in New Issue
Block a user