fixing volume detection for vm environment

This commit is contained in:
thatben 2025-04-21 11:14:54 +02:00
parent c947a71167
commit c76cd357ca
No known key found for this signature in database
GPG Key ID: 62C543548433D43E

View File

@ -9,12 +9,17 @@ export class FsService {
Object.keys(devices).forEach(function (key) {
var val = devices[key];
val.volumes.forEach(function (volume) {
mountPoints.push(volume.mountPoint);
const mount = volume.mountPoint;
if (mount != null && mount != undefined && mount.length > 0) {
mountPoints.push(volume.mountPoint);
}
});
});
if (mountPoints.length < 1) {
throw new Error("Failed to detect file system devices.");
// In certain containerized environments, the devices don't reveal any
// useful mounts. We'll proceed under the assumption that '/' is valid here.
return ['/'];
}
return mountPoints;
};