Skip to content

Commit

Permalink
NAS-134555: Remove ability to set zvol as a container disk
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexKarpov98 committed Mar 4, 2025
1 parent d677c5a commit 81834c2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export class InstanceDiskFormComponent implements OnInit {
return this.filesystem.getFilesystemNodeProvider({ zvolsOnly: true });
}

return this.filesystem.getFilesystemNodeProvider({ datasetsAndZvols: true });
return this.filesystem.getFilesystemNodeProvider({ datasetsOnly: true });
});

protected form = this.formBuilder.nonNullable.group({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,9 +206,7 @@ export class InstanceWizardComponent {
protected readonly isVm = computed(() => this.instanceType() === VirtualizationType.Vm);

readonly directoryNodeProvider = computed(() => {
const providerOptions = this.isVm()
? { zvolsOnly: true }
: { datasetsAndZvols: true };
const providerOptions = this.isVm() ? { zvolsOnly: true } : { datasetsOnly: true };

return this.filesystem.getFilesystemNodeProvider(providerOptions);
});
Expand Down
5 changes: 5 additions & 0 deletions src/app/services/filesystem.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export interface ProviderOptions {
includeSnapshots?: boolean;
datasetsAndZvols?: boolean;
zvolsOnly?: boolean;
datasetsOnly?: boolean;
}

const roolZvolNode = {
Expand Down Expand Up @@ -50,6 +51,7 @@ export class FilesystemService {
includeSnapshots: true,
datasetsAndZvols: false,
zvolsOnly: false,
datasetsOnly: false,
...providerOptions,
};

Expand All @@ -60,6 +62,9 @@ export class FilesystemService {
if (options.zvolsOnly && node.data.path.trim() === '/') {
return of([roolZvolNode]);
}
if (options.datasetsOnly && node.data.path.trim() === '/') {
return of([roolDatasetNode]);
}
const typeFilter: [QueryFilter<FileRecord>?] = [];
if (options.directoriesOnly) {
typeFilter.push(['type', '=', FileType.Directory]);
Expand Down

0 comments on commit 81834c2

Please sign in to comment.