修复自动备份真实挂载解析(07-27-automatic-offhost-backup)
这个提交包含在:
@@ -134,8 +134,18 @@ container_env() {
|
||||
mount_source() {
|
||||
local container_id="$1"
|
||||
local destination="$2"
|
||||
docker inspect -f '{{range .Mounts}}{{println .Destination "\t" .Source}}{{end}}' "$container_id" \
|
||||
| awk -F '\t' -v expected="$destination" '$1 == expected { print $2 }'
|
||||
docker inspect -f '{{json .Mounts}}' "$container_id" \
|
||||
| python3 -c '
|
||||
import json
|
||||
import sys
|
||||
|
||||
destination = sys.argv[1]
|
||||
mounts = json.load(sys.stdin)
|
||||
matches = [mount.get("Source", "") for mount in mounts if mount.get("Destination") == destination]
|
||||
if len(matches) != 1 or not matches[0]:
|
||||
raise SystemExit(1)
|
||||
print(matches[0])
|
||||
' "$destination"
|
||||
}
|
||||
|
||||
resolve_active_runtime() {
|
||||
|
||||
在新工单中引用
屏蔽一个用户