@@ -91,55 +91,6 @@ pub enum SupersetConfigOptions {
9191 AuthLdapTlsCacertfile ,
9292}
9393
94- impl SupersetConfigOptions {
95- /// Mapping from `SupersetConfigOptions` to the values set in `SupersetConfigFragment`.
96- /// `None` is returned if either the according option is not set or is not exposed in the
97- /// `SupersetConfig`.
98- fn config_type_to_string ( & self , superset_config : & SupersetConfigFragment ) -> Option < String > {
99- match self {
100- SupersetConfigOptions :: RowLimit => superset_config. row_limit . map ( |v| v. to_string ( ) ) ,
101- SupersetConfigOptions :: SupersetWebserverTimeout => {
102- superset_config. webserver_timeout . map ( |v| v. to_string ( ) )
103- }
104- _ => None ,
105- }
106- }
107- }
108-
109- impl FlaskAppConfigOptions for SupersetConfigOptions {
110- fn python_type ( & self ) -> PythonType {
111- match self {
112- SupersetConfigOptions :: SecretKey => PythonType :: Expression ,
113- SupersetConfigOptions :: SqlalchemyDatabaseUri => PythonType :: Expression ,
114- SupersetConfigOptions :: StatsLogger => PythonType :: Expression ,
115- SupersetConfigOptions :: RowLimit => PythonType :: IntLiteral ,
116- SupersetConfigOptions :: MapboxApiKey => PythonType :: Expression ,
117- SupersetConfigOptions :: OauthProviders => PythonType :: Expression ,
118- SupersetConfigOptions :: SupersetWebserverTimeout => PythonType :: IntLiteral ,
119- SupersetConfigOptions :: LoggingConfigurator => PythonType :: Expression ,
120- SupersetConfigOptions :: AuthType => PythonType :: Expression ,
121- SupersetConfigOptions :: AuthUserRegistration => PythonType :: BoolLiteral ,
122- SupersetConfigOptions :: AuthUserRegistrationRole => PythonType :: StringLiteral ,
123- SupersetConfigOptions :: AuthRolesSyncAtLogin => PythonType :: BoolLiteral ,
124- SupersetConfigOptions :: AuthLdapServer => PythonType :: StringLiteral ,
125- SupersetConfigOptions :: AuthLdapBindUser => PythonType :: Expression ,
126- SupersetConfigOptions :: AuthLdapBindPassword => PythonType :: Expression ,
127- SupersetConfigOptions :: AuthLdapSearch => PythonType :: StringLiteral ,
128- SupersetConfigOptions :: AuthLdapSearchFilter => PythonType :: StringLiteral ,
129- SupersetConfigOptions :: AuthLdapUidField => PythonType :: StringLiteral ,
130- SupersetConfigOptions :: AuthLdapGroupField => PythonType :: StringLiteral ,
131- SupersetConfigOptions :: AuthLdapFirstnameField => PythonType :: StringLiteral ,
132- SupersetConfigOptions :: AuthLdapLastnameField => PythonType :: StringLiteral ,
133- SupersetConfigOptions :: AuthLdapEmailField => PythonType :: StringLiteral ,
134- SupersetConfigOptions :: AuthLdapAllowSelfSigned => PythonType :: BoolLiteral ,
135- SupersetConfigOptions :: AuthLdapTlsDemand => PythonType :: BoolLiteral ,
136- SupersetConfigOptions :: AuthLdapTlsCertfile => PythonType :: StringLiteral ,
137- SupersetConfigOptions :: AuthLdapTlsKeyfile => PythonType :: StringLiteral ,
138- SupersetConfigOptions :: AuthLdapTlsCacertfile => PythonType :: StringLiteral ,
139- }
140- }
141- }
142-
14394/// A Superset cluster stacklet. This resource is managed by the Stackable operator for Apache Superset.
14495/// Find more information on how to use it and the resources that the operator generates in the
14596/// [operator documentation](DOCS_BASE_URL_PLACEHOLDER/superset/).
@@ -233,16 +184,6 @@ pub enum CurrentlySupportedListenerClasses {
233184 ExternalStable ,
234185}
235186
236- impl CurrentlySupportedListenerClasses {
237- pub fn k8s_service_type ( & self ) -> String {
238- match self {
239- CurrentlySupportedListenerClasses :: ClusterInternal => "ClusterIP" . to_string ( ) ,
240- CurrentlySupportedListenerClasses :: ExternalUnstable => "NodePort" . to_string ( ) ,
241- CurrentlySupportedListenerClasses :: ExternalStable => "LoadBalancer" . to_string ( ) ,
242- }
243- }
244- }
245-
246187#[ derive( Clone , Debug , Deserialize , Eq , PartialEq , Serialize ) ]
247188#[ serde( rename_all = "camelCase" ) ]
248189pub struct SupersetCredentials {
@@ -353,6 +294,82 @@ pub struct SupersetConfig {
353294 pub graceful_shutdown_timeout : Option < Duration > ,
354295}
355296
297+ #[ derive( Clone , Debug , Default , Deserialize , Eq , JsonSchema , PartialEq , Serialize ) ]
298+ #[ serde( rename_all = "camelCase" ) ]
299+ pub struct SupersetClusterStatus {
300+ #[ serde( default ) ]
301+ pub conditions : Vec < ClusterCondition > ,
302+ }
303+
304+ /// A reference to a [`SupersetCluster`]
305+ #[ derive( Clone , Debug , Default , Deserialize , Eq , JsonSchema , PartialEq , Serialize ) ]
306+ #[ serde( rename_all = "camelCase" ) ]
307+ pub struct SupersetClusterRef {
308+ #[ serde( default , skip_serializing_if = "Option::is_none" ) ]
309+ pub name : Option < String > ,
310+ #[ serde( default , skip_serializing_if = "Option::is_none" ) ]
311+ pub namespace : Option < String > ,
312+ }
313+
314+ impl SupersetConfigOptions {
315+ /// Mapping from `SupersetConfigOptions` to the values set in `SupersetConfigFragment`.
316+ /// `None` is returned if either the according option is not set or is not exposed in the
317+ /// `SupersetConfig`.
318+ fn config_type_to_string ( & self , superset_config : & SupersetConfigFragment ) -> Option < String > {
319+ match self {
320+ SupersetConfigOptions :: RowLimit => superset_config. row_limit . map ( |v| v. to_string ( ) ) ,
321+ SupersetConfigOptions :: SupersetWebserverTimeout => {
322+ superset_config. webserver_timeout . map ( |v| v. to_string ( ) )
323+ }
324+ _ => None ,
325+ }
326+ }
327+ }
328+
329+ impl FlaskAppConfigOptions for SupersetConfigOptions {
330+ fn python_type ( & self ) -> PythonType {
331+ match self {
332+ SupersetConfigOptions :: SecretKey => PythonType :: Expression ,
333+ SupersetConfigOptions :: SqlalchemyDatabaseUri => PythonType :: Expression ,
334+ SupersetConfigOptions :: StatsLogger => PythonType :: Expression ,
335+ SupersetConfigOptions :: RowLimit => PythonType :: IntLiteral ,
336+ SupersetConfigOptions :: MapboxApiKey => PythonType :: Expression ,
337+ SupersetConfigOptions :: OauthProviders => PythonType :: Expression ,
338+ SupersetConfigOptions :: SupersetWebserverTimeout => PythonType :: IntLiteral ,
339+ SupersetConfigOptions :: LoggingConfigurator => PythonType :: Expression ,
340+ SupersetConfigOptions :: AuthType => PythonType :: Expression ,
341+ SupersetConfigOptions :: AuthUserRegistration => PythonType :: BoolLiteral ,
342+ SupersetConfigOptions :: AuthUserRegistrationRole => PythonType :: StringLiteral ,
343+ SupersetConfigOptions :: AuthRolesSyncAtLogin => PythonType :: BoolLiteral ,
344+ SupersetConfigOptions :: AuthLdapServer => PythonType :: StringLiteral ,
345+ SupersetConfigOptions :: AuthLdapBindUser => PythonType :: Expression ,
346+ SupersetConfigOptions :: AuthLdapBindPassword => PythonType :: Expression ,
347+ SupersetConfigOptions :: AuthLdapSearch => PythonType :: StringLiteral ,
348+ SupersetConfigOptions :: AuthLdapSearchFilter => PythonType :: StringLiteral ,
349+ SupersetConfigOptions :: AuthLdapUidField => PythonType :: StringLiteral ,
350+ SupersetConfigOptions :: AuthLdapGroupField => PythonType :: StringLiteral ,
351+ SupersetConfigOptions :: AuthLdapFirstnameField => PythonType :: StringLiteral ,
352+ SupersetConfigOptions :: AuthLdapLastnameField => PythonType :: StringLiteral ,
353+ SupersetConfigOptions :: AuthLdapEmailField => PythonType :: StringLiteral ,
354+ SupersetConfigOptions :: AuthLdapAllowSelfSigned => PythonType :: BoolLiteral ,
355+ SupersetConfigOptions :: AuthLdapTlsDemand => PythonType :: BoolLiteral ,
356+ SupersetConfigOptions :: AuthLdapTlsCertfile => PythonType :: StringLiteral ,
357+ SupersetConfigOptions :: AuthLdapTlsKeyfile => PythonType :: StringLiteral ,
358+ SupersetConfigOptions :: AuthLdapTlsCacertfile => PythonType :: StringLiteral ,
359+ }
360+ }
361+ }
362+
363+ impl CurrentlySupportedListenerClasses {
364+ pub fn k8s_service_type ( & self ) -> String {
365+ match self {
366+ CurrentlySupportedListenerClasses :: ClusterInternal => "ClusterIP" . to_string ( ) ,
367+ CurrentlySupportedListenerClasses :: ExternalUnstable => "NodePort" . to_string ( ) ,
368+ CurrentlySupportedListenerClasses :: ExternalStable => "LoadBalancer" . to_string ( ) ,
369+ }
370+ }
371+ }
372+
356373impl SupersetConfig {
357374 pub const CREDENTIALS_SECRET_PROPERTY : & ' static str = "credentialsSecret" ;
358375 pub const MAPBOX_SECRET_PROPERTY : & ' static str = "mapboxSecret" ;
@@ -430,13 +447,6 @@ impl Configuration for SupersetConfigFragment {
430447 }
431448}
432449
433- #[ derive( Clone , Debug , Default , Deserialize , Eq , JsonSchema , PartialEq , Serialize ) ]
434- #[ serde( rename_all = "camelCase" ) ]
435- pub struct SupersetClusterStatus {
436- #[ serde( default ) ]
437- pub conditions : Vec < ClusterCondition > ,
438- }
439-
440450impl HasStatusCondition for SupersetCluster {
441451 fn conditions ( & self ) -> Vec < ClusterCondition > {
442452 match & self . status {
@@ -514,13 +524,3 @@ impl SupersetCluster {
514524 fragment:: validate ( conf_rolegroup) . context ( FragmentValidationFailureSnafu )
515525 }
516526}
517-
518- /// A reference to a [`SupersetCluster`]
519- #[ derive( Clone , Debug , Default , Deserialize , Eq , JsonSchema , PartialEq , Serialize ) ]
520- #[ serde( rename_all = "camelCase" ) ]
521- pub struct SupersetClusterRef {
522- #[ serde( default , skip_serializing_if = "Option::is_none" ) ]
523- pub name : Option < String > ,
524- #[ serde( default , skip_serializing_if = "Option::is_none" ) ]
525- pub namespace : Option < String > ,
526- }
0 commit comments