Add a new resource component for referencing a tls credential resource.
This works pretty much like the join auth resource in that a cluster
refers to a tls credential resource by name - avoiding having to have
potentially sensitive info stored in the cluster resource.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
(cherry picked from commit
ee5b41981a43da8cff889c80b001540538b08af6)
LoginCategory,
PasswordFilter,
SMBClustering,
+ SourceReferenceType,
TLSCredentialType,
UserGroupSourceType,
)
return rc
+@resourcelib.component()
+class TLSSource(_RBase):
+ """Represents TLS Certificates and Keys used to configure SMB related
+ resources.
+ """
+
+ source_type: SourceReferenceType = SourceReferenceType.RESOURCE
+ ref: str = ''
+
+ def validate(self) -> None:
+ if not self.ref:
+ raise ValueError('reference value must be specified')
+ else:
+ validation.check_id(self.ref)
+
+ @resourcelib.customize
+ def _customize_resource(rc: resourcelib.Resource) -> resourcelib.Resource:
+ rc.ref.quiet = True
+ return rc
+
+
@resourcelib.resource('ceph.smb.cluster')
class Cluster(_RBase):
"""Represents a cluster (instance) that is / should be present."""