From: Redouane Kachach Date: Thu, 18 Sep 2025 08:31:14 +0000 (+0200) Subject: mgr/cephadm: Fix RGW spec validation for deprecated rgw cert field X-Git-Tag: v21.0.0~157^2~101^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=521e2a9039cab26f3b264052c8109636569ad61b;p=ceph.git mgr/cephadm: Fix RGW spec validation for deprecated rgw cert field Starting from Tentacle, the rgw_frontend_ssl_certificate field has been deprecated in favor of the new ssl_cert and ssl_key fields. Update the validation logic to run after this field is automatically transformed into the new fields, ensuring proper validation of RGW specs. Signed-off-by: Redouane Kachach --- diff --git a/src/python-common/ceph/deployment/service_spec.py b/src/python-common/ceph/deployment/service_spec.py index 10b1d391f8f1..e9ed6339fcb1 100644 --- a/src/python-common/ceph/deployment/service_spec.py +++ b/src/python-common/ceph/deployment/service_spec.py @@ -1510,17 +1510,22 @@ class RGWSpec(ServiceSpec): return ports def validate(self) -> None: - super(RGWSpec, self).validate() if self.ssl: if not self.ssl_cert and self.rgw_frontend_ssl_certificate: combined_cert = self.rgw_frontend_ssl_certificate if isinstance(combined_cert, list): combined_cert = '\n'.join(combined_cert) + self.certificate_source = CertificateSource.INLINE.value self.ssl_cert, self.ssl_key = parse_combined_pem_file(combined_cert) + self.rgw_frontend_ssl_certificate = None if not (self.ssl_cert and self.ssl_key): raise SpecValidationError("Failed to parse rgw_frontend_ssl_certificate field.") + # This validation is done after adjusting the SSL field so when + # RGW Spec is updated with the right fields before validation + super(RGWSpec, self).validate() + if self.rgw_realm and not self.rgw_zone: raise SpecValidationError( 'Cannot add RGW: Realm specified but no zone specified')