Skip to content

Commit 5c6c4a0

Browse files
author
Dnyaneshwari
committed
mgr/dashboard: Cloning subvolume not listing _nogroup subvolumegroup if there are no subvols in _nogroup
Fixes: https://tracker.ceph.com/issues/67891 Signed-off-by: Dnyaneshwari talwekar <[email protected]>
1 parent c9bd62a commit 5c6c4a0

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs-subvolume-snapshots-list/cephfs-subvolume-snapshots-list.component.ts

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import moment from 'moment';
2626
import { Validators } from '@angular/forms';
2727
import { CdValidators } from '~/app/shared/forms/cd-validators';
2828
import { ModalCdsService } from '~/app/shared/services/modal-cds.service';
29+
import { DEFAULT_SUBVOLUME_GROUP } from '~/app/shared/constants/cephfs';
2930

3031
@Component({
3132
selector: 'cd-cephfs-subvolume-snapshots-list',
@@ -57,6 +58,7 @@ export class CephfsSubvolumeSnapshotsListComponent implements OnInit, OnChanges
5758
isLoading = true;
5859

5960
observables: any = [];
61+
allGroups: any = [];
6062

6163
constructor(
6264
private cephfsSubvolumeGroupService: CephfsSubvolumeGroupService,
@@ -126,8 +128,14 @@ export class CephfsSubvolumeSnapshotsListComponent implements OnInit, OnChanges
126128
.pipe(
127129
switchMap((groups) => {
128130
// manually adding the group '_nogroup' to the list.
129-
groups.unshift({ name: '' });
130131

132+
groups.unshift({ name: '' });
133+
this.allGroups = Array.from(groups).map((group) => {
134+
return {
135+
value: group.name,
136+
text: group.name === '' ? DEFAULT_SUBVOLUME_GROUP : group.name
137+
};
138+
});
131139
const observables = groups.map((group) =>
132140
this.cephfsSubvolumeService.existsInFs(this.fsName, group.name).pipe(
133141
switchMap((resp) => {
@@ -248,9 +256,6 @@ export class CephfsSubvolumeSnapshotsListComponent implements OnInit, OnChanges
248256

249257
cloneModal() {
250258
const cloneName = `clone_${moment().toISOString(true)}`;
251-
const allGroups = Array.from(this.subvolumeGroupList).map((group) => {
252-
return { value: group, text: group === '' ? '_nogroup' : group };
253-
});
254259
this.modalService.show(FormModalComponent, {
255260
titleText: $localize`Create clone`,
256261
fields: [
@@ -284,7 +289,7 @@ export class CephfsSubvolumeSnapshotsListComponent implements OnInit, OnChanges
284289
valueChangeListener: true,
285290
dependsOn: 'cloneName',
286291
typeConfig: {
287-
options: allGroups
292+
options: this.allGroups
288293
}
289294
}
290295
],
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export const DEFAULT_SUBVOLUME_GROUP = '_nogroup';

0 commit comments

Comments
 (0)