Merge pull request #2902 from liusdu/checkpoint

checkpoint: resolve symlink for external bind mount
This commit is contained in:
Mrunal Patel
2021-06-24 22:52:02 -04:00
committed by GitHub
2 changed files with 15 additions and 1 deletions

View File

@@ -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),

View File

@@ -130,6 +130,17 @@ function simple_cr() {
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
}
@test "checkpoint and restore (with --debug)" {
simple_cr --debug
}