mirror of
https://github.com/opencontainers/runc.git
synced 2025-10-05 23:46:57 +08:00
Merge pull request #2902 from liusdu/checkpoint
checkpoint: resolve symlink for external bind mount
This commit is contained in:
@@ -780,6 +780,9 @@ const descriptorsFilename = "descriptors.json"
|
||||
|
||||
func (c *linuxContainer) addCriuDumpMount(req *criurpc.CriuReq, m *configs.Mount) {
|
||||
mountDest := strings.TrimPrefix(m.Destination, c.config.Rootfs)
|
||||
if dest, err := securejoin.SecureJoin(c.config.Rootfs, mountDest); err == nil {
|
||||
mountDest = dest[len(c.config.Rootfs):]
|
||||
}
|
||||
extMnt := &criurpc.ExtMountMap{
|
||||
Key: proto.String(mountDest),
|
||||
Val: proto.String(mountDest),
|
||||
|
@@ -126,7 +126,18 @@ function simple_cr() {
|
||||
done
|
||||
}
|
||||
|
||||
@test "checkpoint and restore " {
|
||||
@test "checkpoint and restore" {
|
||||
simple_cr
|
||||
}
|
||||
|
||||
@test "checkpoint and restore (bind mount, destination is symlink)" {
|
||||
mkdir -p rootfs/real/conf
|
||||
ln -s /real/conf rootfs/conf
|
||||
update_config ' .mounts += [{
|
||||
source: ".",
|
||||
destination: "/conf",
|
||||
options: ["bind"]
|
||||
}]'
|
||||
simple_cr
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user