fix: rewrite tar extract onto target volumes root when it is a cross-device symlink
Hosts like rpc-us-32 put /var/lib/docker (or volumes/) on another mount; tar -C / then EXDEV on every var/lib/docker/volumes/... member. Canonicalize the deepest static prefix (readlink -f /var/lib/docker/volumes) and append a --transform after SLOWDISK_TRANSFORMS. Keying only on /var/lib/docker misses a real docker root with volumes/ as the symlink. No-op on normal hosts. Per-volume _data static-file offload stays on SLOWDISK_TRANSFORMS. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -319,6 +319,17 @@ transfer_volume() {
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
# AFTER SLOWDISK_TRANSFORMS: rewrite remaining var/lib/docker/ members onto
|
||||
# the target's real docker root when it is a cross-device symlink (see
|
||||
# docker_root_transform in volume-utils.sh).
|
||||
local _drt
|
||||
_drt=$(docker_root_transform)
|
||||
if [[ -n "$_drt" ]]; then
|
||||
echo "Target /var/lib/docker is a symlink; appending docker-root --transform (after slowdisk)"
|
||||
tar_extract_opts="${tar_extract_opts}${_drt}"
|
||||
fi
|
||||
|
||||
# Find an available port
|
||||
local port=$(find_available_port)
|
||||
if [[ $? -ne 0 ]]; then
|
||||
@@ -500,6 +511,17 @@ transfer_volume_ssh() {
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
# AFTER SLOWDISK_TRANSFORMS: rewrite remaining var/lib/docker/ members onto
|
||||
# the target's real docker root when it is a cross-device symlink (see
|
||||
# docker_root_transform in volume-utils.sh).
|
||||
local _drt
|
||||
_drt=$(docker_root_transform)
|
||||
if [[ -n "$_drt" ]]; then
|
||||
echo "Target /var/lib/docker is a symlink; appending docker-root --transform (after slowdisk)"
|
||||
tar_extract_opts="${tar_extract_opts}${_drt}"
|
||||
fi
|
||||
|
||||
echo "Using direct SSH transfer for $key (size: $((folder_size / 1048576))MB)"
|
||||
|
||||
tar -cf - --dereference "$source_folder" 2>/dev/null | \
|
||||
|
||||
Reference in New Issue
Block a user