Skip to content

Commit

Permalink
NAS-125502: Don't check for mixed capacity (#9283)
Browse files Browse the repository at this point in the history
  • Loading branch information
RehanY147 authored Dec 7, 2023
1 parent 957984c commit 9c90775
Showing 1 changed file with 1 addition and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import {
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
import { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy';
import { combineLatest, map } from 'rxjs';
import { GiB, MiB } from 'app/constants/bytes.constant';
import { CreateVdevLayout } from 'app/enums/v-dev-type.enum';
import { Enclosure } from 'app/interfaces/enclosure.interface';
import { UnusedDisk } from 'app/interfaces/storage.interface';
Expand Down Expand Up @@ -39,27 +38,13 @@ export class ManualDiskSelectionComponent implements OnInit {
]).pipe(
map(([vdevs, layout]) => {
let vdevError = false;
let diskSizeError = false;
const swapondrive = 2;
let smallestdisk = 0;
const swapsize = swapondrive * GiB;
for (const vdev of vdevs) {
if (vdev.disks?.length < minDisksPerLayout[layout]) {
vdevError = true;
}
for (let i = 0; i < vdev.disks.length; i++) {
const size = vdev.disks[i].size - swapsize;
if (i === 0) {
smallestdisk = size;
}
const tenMib = 10 * MiB;
if (size > smallestdisk + tenMib || size < smallestdisk - tenMib) {
diskSizeError = true;
}
}
}

return vdevError || diskSizeError;
return vdevError;
}),
);

Expand Down

0 comments on commit 9c90775

Please sign in to comment.