Skip to content

Commit

Permalink
fix(api): assign host used, if only one drive exists
Browse files Browse the repository at this point in the history
fixes #214
  • Loading branch information
MauriceNino committed Jul 18, 2022
1 parent a3e9a63 commit 38e62bc
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions apps/api/src/dynamic-info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,9 @@ export const getDynamicServerInfo = () => {
);
const hostMountUsed =
(
sizes.find(({ mount }) => mount === '/mnt/host') ??
sizes.find(({ mount }) => mount === '/')
sizes.find(
({ mount, type }) => type !== 'squashfs' && mount === '/mnt/host'
) ?? sizes.find(({ mount }) => mount === '/')
)?.used ?? 0;
const validParts = blocks.filter(({ type }) => type === 'part');

Expand All @@ -134,7 +135,9 @@ export const getDynamicServerInfo = () => {
deviceParts.some(
({ mount }) =>
mount === '/mnt/host' || mount.startsWith('/mnt/host/boot/')
);
) ||
// if there is only one drive, it has to be the host
storageLayout.length === 1;

// Apply all unclaimed partitions to the host disk
if (potentialHost && !hostFound) {
Expand Down

0 comments on commit 38e62bc

Please sign in to comment.