@@ -5,7 +5,7 @@ use quote::quote;
55use syn:: { Generics , ItemStruct } ;
66
77use crate :: {
8- attrs:: container:: { ContainerAttributes , StructCrdArguments } ,
8+ attrs:: container:: { ContainerAttributes , Scale , StructCrdArguments } ,
99 codegen:: {
1010 Direction , VersionContext , VersionDefinition ,
1111 changes:: Neighbors ,
@@ -272,20 +272,27 @@ impl Struct {
272272 _ => None ,
273273 } ;
274274
275- let scale = spec_gen_ctx. kubernetes_arguments . scale . as_ref ( ) . map ( |s| {
276- let spec_replicas_path = & s. spec_replicas_path ;
277- let status_replicas_path = & s. status_replicas_path ;
278- let label_selector_path = s
279- . label_selector_path
280- . as_ref ( )
281- . map ( |p| quote ! { , label_selector_path = #p } ) ;
282-
283- quote ! { , scale(
284- spec_replicas_path = #spec_replicas_path,
285- status_replicas_path = #status_replicas_path
286- #label_selector_path
287- ) }
288- } ) ;
275+ let scale = spec_gen_ctx
276+ . kubernetes_arguments
277+ . scale
278+ . as_ref ( )
279+ . map ( |scale| {
280+ let Scale {
281+ spec_replicas_path,
282+ status_replicas_path,
283+ label_selector_path,
284+ } = scale;
285+
286+ let label_selector_path = label_selector_path
287+ . as_ref ( )
288+ . map ( |p| quote ! { , label_selector_path = #p } ) ;
289+
290+ quote ! { , scale(
291+ spec_replicas_path = #spec_replicas_path,
292+ status_replicas_path = #status_replicas_path
293+ #label_selector_path
294+ ) }
295+ } ) ;
289296
290297 let shortnames: TokenStream = spec_gen_ctx
291298 . kubernetes_arguments
0 commit comments