@@ -118,19 +118,19 @@ pub enum Error {
118118#[ serde(
119119 rename_all = "camelCase" ,
120120 bound(
121- deserialize = "T : Default + Deserialize<'de>, CommonConfig: Default + Deserialize<'de>, ConfigOverrides: Default + Deserialize<'de>"
121+ deserialize = "Config : Default + Deserialize<'de>, CommonConfig: Default + Deserialize<'de>, ConfigOverrides: Default + Deserialize<'de>"
122122 )
123123) ]
124124#[ schemars(
125- bound = "T : JsonSchema, CommonConfig: JsonSchema, ConfigOverrides: Default + JsonSchema"
125+ bound = "Config : JsonSchema, CommonConfig: JsonSchema, ConfigOverrides: Default + JsonSchema"
126126) ]
127- pub struct CommonConfiguration < T , CommonConfig , ConfigOverrides > {
127+ pub struct CommonConfiguration < Config , CommonConfig , ConfigOverrides > {
128128 #[ serde( default ) ]
129- // We can't depend on T being `Default`, since that trait is not object-safe
129+ // We can't depend on Config being `Default`, since that trait is not object-safe
130130 // We only need to generate schemas for fully specified types, but schemars_derive
131131 // does not support specifying custom bounds.
132132 #[ schemars( default = "Self::default_config" ) ]
133- pub config : T ,
133+ pub config : Config ,
134134
135135 /// The `configOverrides` can be used to configure properties in product config files
136136 /// that are not exposed in the CRD. Read the
@@ -174,8 +174,8 @@ pub struct CommonConfiguration<T, CommonConfig, ConfigOverrides> {
174174 pub product_specific_common_config : CommonConfig ,
175175}
176176
177- impl < T , CommonConfig , ConfigOverrides >
178- CommonConfiguration < T , CommonConfig , ConfigOverrides >
177+ impl < Config , CommonConfig , ConfigOverrides >
178+ CommonConfiguration < Config , CommonConfig , ConfigOverrides >
179179{
180180 fn default_config ( ) -> serde_json:: Value {
181181 serde_json:: json!( { } )
@@ -296,45 +296,45 @@ impl JvmArgumentOverrides {
296296// Everything below is only a "normal" comment, not rustdoc - so we don't bloat the CRD documentation
297297// with technical (Rust) details.
298298//
299- // `T ` here is the `config` shared between role and roleGroup.
299+ // `Config ` here is the `config` shared between role and roleGroup.
300300//
301- // `U ` here is the `roleConfig` only available on the role. It defaults to [`GenericRoleConfig`], which is
301+ // `RoleConfig ` here is the `roleConfig` only available on the role. It defaults to [`GenericRoleConfig`], which is
302302// sufficient for most of the products. There are some exceptions, where e.g. [`EmptyRoleConfig`] is used.
303303// However, product-operators can define their own - custom - struct and use that here.
304304#[ derive( Clone , Debug , Default , Deserialize , JsonSchema , PartialEq , Serialize ) ]
305305#[ serde( rename_all = "camelCase" ) ]
306306pub struct Role <
307- T ,
307+ Config ,
308308 ConfigOverrides ,
309- U = GenericRoleConfig ,
309+ RoleConfig = GenericRoleConfig ,
310310 CommonConfig = GenericCommonConfig ,
311311> where
312312 // Don't remove this trait bounds!!!
313313 // We don't know why, but if you remove either of them, the generated default value in the CRDs will
314314 // be missing!
315- U : Default + JsonSchema + Serialize ,
315+ RoleConfig : Default + JsonSchema + Serialize ,
316316 CommonConfig : Default + JsonSchema + Serialize ,
317317 ConfigOverrides : Default + JsonSchema + Serialize ,
318318{
319319 #[ serde(
320320 flatten,
321321 bound(
322- deserialize = "T : Default + Deserialize<'de>, CommonConfig: Deserialize<'de>, ConfigOverrides: Deserialize<'de>"
322+ deserialize = "Config : Default + Deserialize<'de>, CommonConfig: Deserialize<'de>, ConfigOverrides: Deserialize<'de>"
323323 )
324324 ) ]
325- pub config : CommonConfiguration < T , CommonConfig , ConfigOverrides > ,
325+ pub config : CommonConfiguration < Config , CommonConfig , ConfigOverrides > ,
326326
327327 #[ serde( default ) ]
328- pub role_config : U ,
328+ pub role_config : RoleConfig ,
329329
330- pub role_groups : HashMap < String , RoleGroup < T , CommonConfig , ConfigOverrides > > ,
330+ pub role_groups : HashMap < String , RoleGroup < Config , CommonConfig , ConfigOverrides > > ,
331331}
332332
333- impl < T , ConfigOverrides , U , CommonConfig >
334- Role < T , ConfigOverrides , U , CommonConfig >
333+ impl < Config , ConfigOverrides , RoleConfig , CommonConfig >
334+ Role < Config , ConfigOverrides , RoleConfig , CommonConfig >
335335where
336- T : Configuration + ' static ,
337- U : Default + JsonSchema + Serialize ,
336+ Config : Configuration + ' static ,
337+ RoleConfig : Default + JsonSchema + Serialize ,
338338 CommonConfig : Default + JsonSchema + Serialize + Clone ,
339339 ConfigOverrides : Default + JsonSchema + Serialize ,
340340{
@@ -346,15 +346,15 @@ where
346346 pub fn erase (
347347 self ,
348348 ) -> Role <
349- Box < dyn Configuration < Configurable = T :: Configurable > > ,
349+ Box < dyn Configuration < Configurable = Config :: Configurable > > ,
350350 ConfigOverrides ,
351- U ,
351+ RoleConfig ,
352352 CommonConfig ,
353353 > {
354354 Role {
355355 config : CommonConfiguration {
356356 config : Box :: new ( self . config . config )
357- as Box < dyn Configuration < Configurable = T :: Configurable > > ,
357+ as Box < dyn Configuration < Configurable = Config :: Configurable > > ,
358358 config_overrides : self . config . config_overrides ,
359359 env_overrides : self . config . env_overrides ,
360360 cli_overrides : self . config . cli_overrides ,
@@ -371,7 +371,7 @@ where
371371 RoleGroup {
372372 config : CommonConfiguration {
373373 config : Box :: new ( group. config . config )
374- as Box < dyn Configuration < Configurable = T :: Configurable > > ,
374+ as Box < dyn Configuration < Configurable = Config :: Configurable > > ,
375375 config_overrides : group. config . config_overrides ,
376376 env_overrides : group. config . env_overrides ,
377377 cli_overrides : group. config . cli_overrides ,
@@ -389,9 +389,9 @@ where
389389 }
390390}
391391
392- impl < T , ConfigOverrides , U > Role < T , ConfigOverrides , U , JavaCommonConfig >
392+ impl < Config , ConfigOverrides , RoleConfig > Role < Config , ConfigOverrides , RoleConfig , JavaCommonConfig >
393393where
394- U : Default + JsonSchema + Serialize ,
394+ RoleConfig : Default + JsonSchema + Serialize ,
395395 ConfigOverrides : Default + JsonSchema + Serialize ,
396396{
397397 /// Merges jvm argument overrides from
@@ -445,30 +445,30 @@ pub struct EmptyRoleConfig {}
445445#[ serde(
446446 rename_all = "camelCase" ,
447447 bound(
448- deserialize = "T : Default + Deserialize<'de>, CommonConfig: Default + Deserialize<'de>, ConfigOverrides: Default + Deserialize<'de>"
448+ deserialize = "Config : Default + Deserialize<'de>, CommonConfig: Default + Deserialize<'de>, ConfigOverrides: Default + Deserialize<'de>"
449449 )
450450) ]
451451#[ schemars(
452- bound = "T : JsonSchema, CommonConfig: JsonSchema, ConfigOverrides: Default + JsonSchema"
452+ bound = "Config : JsonSchema, CommonConfig: JsonSchema, ConfigOverrides: Default + JsonSchema"
453453) ]
454- pub struct RoleGroup < T , CommonConfig , ConfigOverrides > {
454+ pub struct RoleGroup < Config , CommonConfig , ConfigOverrides > {
455455 #[ serde( flatten) ]
456- pub config : CommonConfiguration < T , CommonConfig , ConfigOverrides > ,
456+ pub config : CommonConfiguration < Config , CommonConfig , ConfigOverrides > ,
457457 pub replicas : Option < u16 > ,
458458}
459459
460- impl < T , CommonConfig , ConfigOverrides >
461- RoleGroup < T , CommonConfig , ConfigOverrides >
460+ impl < Config , CommonConfig , ConfigOverrides >
461+ RoleGroup < Config , CommonConfig , ConfigOverrides >
462462{
463- pub fn validate_config < C , U > (
463+ pub fn validate_config < C , RoleConfig > (
464464 & self ,
465- role : & Role < T , ConfigOverrides , U , CommonConfig > ,
466- default_config : & T ,
465+ role : & Role < Config , ConfigOverrides , RoleConfig , CommonConfig > ,
466+ default_config : & Config ,
467467 ) -> Result < C , fragment:: ValidationError >
468468 where
469- C : FromFragment < Fragment = T > ,
470- T : Merge + Clone ,
471- U : Default + JsonSchema + Serialize ,
469+ C : FromFragment < Fragment = Config > ,
470+ Config : Merge + Clone ,
471+ RoleConfig : Default + JsonSchema + Serialize ,
472472 CommonConfig : Default + JsonSchema + Serialize ,
473473 ConfigOverrides : Default + JsonSchema + Serialize ,
474474 {
0 commit comments