]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: fix bucket encryption checkbox 49776/head
authorAashish Sharma <aasharma@redhat.com>
Tue, 17 Jan 2023 09:56:34 +0000 (15:26 +0530)
committerAashish Sharma <aasharma@redhat.com>
Wed, 18 Jan 2023 05:44:32 +0000 (11:14 +0530)
Fixes: https://tracker.ceph.com/issues/58474
The encryption checkbox in the bucket creation form remains disabled after setting the vault authentication method as agent.

Signed-off-by: Aashish Sharma <aasharma@redhat.com>
(cherry picked from commit aea92059f4fd795e3556b0c67638dd1045ce5fdc)

src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-config-modal/rgw-config-modal.component.html
src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-config-modal/rgw-config-modal.component.ts
src/pybind/mgr/dashboard/services/ceph_service.py

index 88c394232e9509f72f3a7428804c367133962ba3..b991eb0ce34a90d7b0fbb7c2a2befc65211940f7 100644 (file)
         </div>
       </div>
 
-      <div *ngIf="configForm.getValue('auth_method') == 'agent'">
-        <div class="form-group row">
-          <label class="cd-col-form-label required"
-                 for="role"
-                 i18n>Role
-          </label>
-          <div class="cd-col-form-input">
-            <input id="role"
-                   name="role"
-                   class="form-control"
-                   formControlName="role">
-            <span class="invalid-feedback"
-                  *ngIf="configForm.showError('role', frm, 'required')"
-                  i18n>This field is required.</span>
-          </div>
-        </div>
-      </div>
-
-      <div *ngIf="configForm.getValue('encryptionType') == 'aws:kms' || configForm.getValue('encryptionType') == 'AES256'">
+      <div *ngIf="configForm.getValue('encryptionType') === 'aws:kms' || configForm.getValue('encryptionType') === 'AES256'">
         <div class="form-group row">
           <label class="cd-col-form-label"
                  for="ssl_cert">
index 2b45055679e595095788f994b1b8d3306c397a37..bc181a7605d59f1b5824ec257a00bd010489ca5a 100644 (file)
@@ -80,14 +80,6 @@ export class RgwConfigModalComponent implements OnInit {
       ssl_cert: [null, CdValidators.sslCert()],
       client_cert: [null, CdValidators.pemCert()],
       client_key: [null, CdValidators.sslPrivKey()],
-      role: [
-        null,
-        [
-          CdValidators.requiredIf({
-            auth_method: 'agent'
-          })
-        ]
-      ],
       kmsEnabled: [{ value: false }],
       s3Enabled: [{ value: false }]
     });
index f90c4e6fd64183722e5466673e726eebfc46685b..422375f4aff55cbbc8ee087e34ea3b3e4ac9408f 100644 (file)
@@ -211,13 +211,11 @@ class CephService(object):
             kms_vault_token: str = CephService.send_command('mon', 'config get',
                                                             who=name_to_config_section(full_daemon_name),  # noqa E501 #pylint: disable=line-too-long
                                                             key='rgw_crypt_vault_token_file')  # noqa E501 #pylint: disable=line-too-long
-            if (
-                kms_vault_auth.strip() != ""
-                and kms_vault_engine.strip() != ""
-                and kms_vault_address.strip() != ""
-                and kms_vault_token.strip() != ""
-            ):
-                kms_vault_configured = True
+            if (kms_vault_auth.strip() != "" and kms_vault_engine.strip() != "" and kms_vault_address.strip() != ""):  # noqa E501 #pylint: disable=line-too-long
+                if(kms_vault_auth == 'token' and kms_vault_token.strip() == ""):
+                    kms_vault_configured = False
+                else:
+                    kms_vault_configured = True
 
         if sse_s3_backend.strip() == 'vault':
             s3_vault_auth: str = CephService.send_command('mon', 'config get',
@@ -233,13 +231,12 @@ class CephService(object):
             s3_vault_token: str = CephService.send_command('mon', 'config get',
                                                            who=name_to_config_section(full_daemon_name),  # noqa E501 #pylint: disable=line-too-long
                                                            key='rgw_crypt_sse_s3_vault_token_file')  # noqa E501 #pylint: disable=line-too-long
-            if (
-                s3_vault_auth.strip() != ""
-                and s3_vault_engine.strip() != ""
-                and s3_vault_address.strip() != ""
-                and s3_vault_token.strip() != ""
-            ):
-                s3_vault_configured = True
+
+            if (s3_vault_auth.strip() != "" and s3_vault_engine.strip() != "" and s3_vault_address.strip() != ""):  # noqa E501 #pylint: disable=line-too-long
+                if(s3_vault_auth == 'token' and s3_vault_token.strip() == ""):
+                    s3_vault_configured = False
+                else:
+                    s3_vault_configured = True
 
         vault_stats.append(kms_vault_configured)
         vault_stats.append(s3_vault_configured)