We should not allow changing an export's cluster because an export ID
might live in one cluster but not in another one. Editing a non-existing
export in a cluster causes an error.
Fixes: https://tracker.ceph.com/issues/47373
Signed-off-by: Kiefer Chang <kiefer.chang@suse.com>
(cherry picked from commit
d678d8076c2a4c5edfe489d553e3c8770462f023)
Conflicts:
src/pybind/mgr/dashboard/frontend/src/app/ceph/nfs/nfs-form/nfs-form.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/nfs/nfs-list/nfs-list.component.spec.ts
- Some imports differ from master; remove SummaryService and CephReleaseNamePipe from providers
and no longer needed test case; also remove not working docsUrl (and related lines) from
nfs-form.component.ts
transportTCP: true,
transportUDP: true
});
+ expect(component.nfsForm.get('cluster_id').disabled).toBeFalsy();
});
it('should prepare data when selecting an cluster', () => {
expect(component.nfsForm.getValue('daemons')).toEqual([]);
});
+ it('should not allow changing cluster in edit mode', () => {
+ component.isEdit = true;
+ component.ngOnInit();
+ expect(component.nfsForm.get('cluster_id').disabled).toBeTruthy();
+ });
+
describe('should submit request', () => {
beforeEach(() => {
component.nfsForm.patchValue({
this.getData(promises);
});
+ this.nfsForm.get('cluster_id').disable();
} else {
this.action = this.actionLabels.CREATE;
this.getData(promises);