1+ use stackable_operator:: v2:: types:: kubernetes:: SecretClassName ;
2+
13use crate :: crd:: {
24 STACKABLE_TRUST_STORE_PASSWORD , authentication:: AuthenticationClassesResolved , v1alpha1,
35} ;
@@ -9,7 +11,7 @@ pub struct DruidTlsSecurity {
911 tls_authentication_enabled : bool ,
1012 /// The TLS `SecretClass` used for external client -> server and server <-> server
1113 /// communication, if any.
12- server_and_internal_secret_class : Option < String > ,
14+ server_and_internal_secret_class : Option < SecretClassName > ,
1315}
1416
1517// Port names (shared with the build-side renderer and other build modules)
@@ -26,7 +28,7 @@ impl DruidTlsSecurity {
2628 #[ cfg( test) ]
2729 pub ( crate ) fn new (
2830 tls_authentication_enabled : bool ,
29- server_and_internal_secret_class : Option < String > ,
31+ server_and_internal_secret_class : Option < SecretClassName > ,
3032 ) -> Self {
3133 Self {
3234 tls_authentication_enabled,
@@ -42,13 +44,12 @@ impl DruidTlsSecurity {
4244 ) -> Self {
4345 DruidTlsSecurity {
4446 tls_authentication_enabled : auth_classes. tls_authentication_enabled ( ) ,
45- server_and_internal_secret_class : druid. spec . cluster_config . tls . as_ref ( ) . and_then (
46- |tls| {
47- tls. server_and_internal_secret_class
48- . as_ref ( )
49- . map ( |secret_class| secret_class. to_string ( ) )
50- } ,
51- ) ,
47+ server_and_internal_secret_class : druid
48+ . spec
49+ . cluster_config
50+ . tls
51+ . as_ref ( )
52+ . and_then ( |tls| tls. server_and_internal_secret_class . clone ( ) ) ,
5253 }
5354 }
5455
@@ -71,8 +72,8 @@ impl DruidTlsSecurity {
7172
7273 /// The optional TLS `SecretClass` for external client -> server and server <-> server
7374 /// communication.
74- pub ( crate ) fn server_and_internal_secret_class ( & self ) -> Option < & str > {
75- self . server_and_internal_secret_class . as_deref ( )
75+ pub ( crate ) fn server_and_internal_secret_class ( & self ) -> Option < & SecretClassName > {
76+ self . server_and_internal_secret_class . as_ref ( )
7677 }
7778}
7879
0 commit comments