]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: Encryption key not being passed in gateway group form 68547/head
authorAfreen Misbah <afreen@ibm.com>
Wed, 22 Apr 2026 11:13:46 +0000 (16:43 +0530)
committerAfreen Misbah <afreen@ibm.com>
Wed, 22 Apr 2026 11:23:57 +0000 (16:53 +0530)
- encryption_key despite fo being added by user is not added in service spec
- this blocks both bi and uni directional auth

Fixes https://tracker.ceph.com/issues/76214

Signed-off-by: Afreen Misbah <afreen@ibm.com>
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/nvmeof-group-form/nvmeof-group-form.component.html
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/nvmeof-group-form/nvmeof-group-form.component.ts

index 9d8587bebe9ec21593cdaae34303487005045eca..27a5de864210dbf00dce990e6ed97b6773816491 100644 (file)
             i18n-helperText>Encryption configuration
             <textarea cdsTextArea
                       id="cdsInput"
+                      cdValidate
+                      #encryptionConfig="cdValidate"
+                      [invalid]="encryptionConfig.invalid"
+                      [invalidText]="encryptionConfigError"
                       formControlName="encryptionConfig"
                       cols="100"
                       rows="4">
           </cds-textarea-label>
         </div>
       </div>
+      <ng-template #encryptionConfigError>
+        <span *ngIf="groupForm.controls.encryptionConfig.hasError('required')"
+              class="invalid-feedback"
+              i18n>This field is required.</span>
+      </ng-template>
       }
-
       <!-- Target Nodes Selection -->
       <div
         cdsRow
     </div>
   </div>
 </form>
-
-
index 7fd270e51ec772fff0822e455c5e87083222ac9b..533025735bcac6f0177c626c977a7f3cb69c63a9 100644 (file)
@@ -75,6 +75,16 @@ export class NvmeofGroupFormComponent extends CdForm implements OnInit {
       enableEncryption: new UntypedFormControl(false),
       encryptionConfig: new UntypedFormControl(null)
     });
+
+    this.groupForm.get('enableEncryption')?.valueChanges.subscribe((enabled) => {
+      const encryptionControl = this.groupForm.get('encryptionConfig');
+      if (enabled) {
+        encryptionControl?.setValidators([Validators.required]);
+      } else {
+        encryptionControl?.clearValidators();
+      }
+      encryptionControl?.updateValueAndValidity();
+    });
   }
 
   onHostsLoaded(count: number): void {
@@ -159,8 +169,8 @@ export class NvmeofGroupFormComponent extends CdForm implements OnInit {
       unmanaged: formValues.unmanaged
     };
 
-    if (formValues.enableCds && formValues.cdsInput) {
-      serviceSpec['encryption_key'] = formValues.cdsInput;
+    if (formValues.enableEncryption && formValues.encryptionConfig) {
+      serviceSpec['encryption_key'] = formValues.encryptionConfig;
     }
 
     this.taskWrapperService