mirror of
https://github.com/ceph/ceph
synced 2025-02-24 03:27:10 +00:00
mgr/dashboard: Fix iSCSI target submission
cdIsInGroup should not be included in the request and username/password should be an empty string (instead of null) Fixes: https://tracker.ceph.com/issues/39110 Signed-off-by: Ricardo Marques <rimarques@suse.com>
This commit is contained in:
parent
27df199891
commit
d63f206310
@ -351,8 +351,7 @@ describe('IscsiTargetFormComponent', () => {
|
||||
expect(req.request.body).toEqual({
|
||||
clients: [
|
||||
{
|
||||
auth: { mutual_password: null, mutual_user: null, password: null, user: null },
|
||||
cdIsInGroup: false,
|
||||
auth: { mutual_password: '', mutual_user: '', password: '', user: '' },
|
||||
client_iqn: 'iqn.initiator',
|
||||
luns: []
|
||||
}
|
||||
@ -380,8 +379,7 @@ describe('IscsiTargetFormComponent', () => {
|
||||
expect(req.request.body).toEqual({
|
||||
clients: [
|
||||
{
|
||||
auth: { mutual_password: null, mutual_user: null, password: null, user: null },
|
||||
cdIsInGroup: false,
|
||||
auth: { mutual_password: '', mutual_user: '', password: '', user: '' },
|
||||
client_iqn: 'iqn.initiator',
|
||||
luns: []
|
||||
}
|
||||
|
@ -544,7 +544,7 @@ export class IscsiTargetFormComponent implements OnInit {
|
||||
}
|
||||
|
||||
submit() {
|
||||
const formValue = this.targetForm.value;
|
||||
const formValue = _.cloneDeep(this.targetForm.value);
|
||||
|
||||
const request = {
|
||||
target_iqn: this.targetForm.getValue('target_iqn'),
|
||||
@ -581,17 +581,18 @@ export class IscsiTargetFormComponent implements OnInit {
|
||||
if (request.acl_enabled) {
|
||||
formValue.initiators.forEach((initiator) => {
|
||||
if (!initiator.auth.user) {
|
||||
initiator.auth.user = null;
|
||||
initiator.auth.user = '';
|
||||
}
|
||||
if (!initiator.auth.password) {
|
||||
initiator.auth.password = null;
|
||||
initiator.auth.password = '';
|
||||
}
|
||||
if (!initiator.auth.mutual_user) {
|
||||
initiator.auth.mutual_user = null;
|
||||
initiator.auth.mutual_user = '';
|
||||
}
|
||||
if (!initiator.auth.mutual_password) {
|
||||
initiator.auth.mutual_password = null;
|
||||
initiator.auth.mutual_password = '';
|
||||
}
|
||||
delete initiator.cdIsInGroup;
|
||||
|
||||
const newLuns = [];
|
||||
initiator.luns.forEach((lun) => {
|
||||
|
Loading…
Reference in New Issue
Block a user