exclude docker sockets and host system paths from volume backups

This commit is contained in:
jarek committed 2026-07-31 10:10:55 +02:00
1 parent 36dac8b030
commit 25f10616a5
4 files changed
+76 -9

No files matched your search

+10
View File
@@ -13,6 +13,8 @@
* quietly omits data is exactly the failure mode we refuse.
*/
import { isUnbackupableBindSource } from '../../utils/unbackupable-mounts';
/** A single mount as returned by a container inspect (the fields we use). */
export interface Mount {
Type: string;
@@ -102,6 +104,14 @@ export function discoverVolumesFromMounts(containers: Array<{ name: string; moun
source: mount.Name,
});
} else if (mount.Type === 'bind' && mount.Source && mount.Destination) {
if (isUnbackupableBindSource(mount.Source)) {
skipped.push({
type: 'bind',
destination: mount.Destination,
reason: `${mount.Source} is a socket or host system path, not backed up`,
});
continue;
}
const pairKey = `${mount.Source}\n${mount.Destination}`;
if (seenBindPairs.has(pairKey)) continue;
seenBindPairs.add(pairKey);