1+ use std:: str:: FromStr ;
2+
13use databases:: MetadataDatabaseConnection ;
24/// Re-export of the shared product-logging spec data types (test-only).
35///
@@ -36,8 +38,12 @@ use stackable_operator::{
3638 shared:: time:: Duration ,
3739 status:: condition:: { ClusterCondition , HasStatusCondition } ,
3840 v2:: {
39- config_overrides:: KeyValueConfigOverrides , role_utils:: JavaCommonConfig ,
40- types:: common:: Port ,
41+ config_overrides:: KeyValueConfigOverrides ,
42+ role_utils:: JavaCommonConfig ,
43+ types:: {
44+ common:: Port ,
45+ kubernetes:: { ConfigMapName , ListenerClassName , SecretClassName } ,
46+ } ,
4147 } ,
4248 versioned:: versioned,
4349} ;
@@ -76,8 +82,9 @@ pub const STACKABLE_TRUST_STORE_PASSWORD: &str = "changeit";
7682pub const DEFAULT_LISTENER_CLASS : & str = "cluster-internal" ;
7783
7884// used by crds to define a default listener_class name
79- pub fn metastore_default_listener_class ( ) -> String {
80- DEFAULT_LISTENER_CLASS . to_owned ( )
85+ pub fn metastore_default_listener_class ( ) -> ListenerClassName {
86+ ListenerClassName :: from_str ( DEFAULT_LISTENER_CLASS )
87+ . expect ( "the default listener class is a valid listener class name" )
8188}
8289
8390const DEFAULT_METASTORE_GRACEFUL_SHUTDOWN_TIMEOUT : Duration = Duration :: from_minutes_unchecked ( 5 ) ;
@@ -154,7 +161,7 @@ pub mod versioned {
154161
155162 /// This field controls which [ListenerClass](DOCS_BASE_URL_PLACEHOLDER/listener-operator/listenerclass.html) is used to expose the metastore.
156163 #[ serde( default = "metastore_default_listener_class" ) ]
157- pub listener_class : String ,
164+ pub listener_class : ListenerClassName ,
158165 }
159166
160167 #[ derive( Clone , Debug , Deserialize , JsonSchema , PartialEq , Serialize ) ]
@@ -185,7 +192,7 @@ pub mod versioned {
185192 /// Follow the [logging tutorial](DOCS_BASE_URL_PLACEHOLDER/tutorials/logging-vector-aggregator)
186193 /// to learn how to configure log aggregation with Vector.
187194 #[ serde( skip_serializing_if = "Option::is_none" ) ]
188- pub vector_aggregator_config_map_name : Option < String > ,
195+ pub vector_aggregator_config_map_name : Option < ConfigMapName > ,
189196 }
190197
191198 #[ derive( Clone , Debug , Default , Deserialize , Eq , JsonSchema , Merge , PartialEq , Serialize ) ]
@@ -228,7 +235,7 @@ impl v1alpha1::HiveCluster {
228235 self . kerberos_secret_class ( ) . is_some ( )
229236 }
230237
231- pub fn kerberos_secret_class ( & self ) -> Option < String > {
238+ pub fn kerberos_secret_class ( & self ) -> Option < SecretClassName > {
232239 self . spec
233240 . cluster_config
234241 . authentication
@@ -253,7 +260,7 @@ pub struct HdfsConnection {
253260 /// providing information about the HDFS cluster.
254261 /// See also the [Stackable Operator for HDFS](DOCS_BASE_URL_PLACEHOLDER/hdfs/) to learn
255262 /// more about setting up an HDFS cluster.
256- pub config_map : String ,
263+ pub config_map : ConfigMapName ,
257264}
258265
259266#[ derive( Clone , Debug , Display , EnumString , EnumIter , Eq , Hash , Ord , PartialEq , PartialOrd ) ]
0 commit comments