@@ -50,6 +50,7 @@ pub struct ContainerSkipArguments {
5050/// cluster scoped resource.
5151/// - `crates`: Override specific crates.
5252/// - `status`: Set the specified struct as the status subresource.
53+ /// - `scale`: Configure the scale subresource for horizontal pod autoscaling integration.
5354/// - `shortname`: Set a shortname for the CR object. This can be specified multiple
5455/// times.
5556/// - `skip`: Controls skipping parts of the generation.
@@ -64,7 +65,7 @@ pub struct StructCrdArguments {
6465 pub status : Option < Path > ,
6566 // derive
6667 // schema
67- // scale
68+ pub scale : Option < Scale > ,
6869 // printcolumn
6970 #[ darling( multiple, rename = "shortname" ) ]
7071 pub shortnames : Vec < String > ,
@@ -74,3 +75,21 @@ pub struct StructCrdArguments {
7475 // annotation
7576 // label
7677}
78+
79+ /// Scale subresource configuration for a CRD.
80+ ///
81+ /// Mirrors the fields of [`k8s_openapi::CustomResourceSubresourceScale`][1] and what is present in
82+ /// `kube_derive`.
83+ ///
84+ /// [1]: k8s_openapi::apiextensions_apiserver::pkg::apis::apiextensions::v1::CustomResourceSubresourceScale
85+ //
86+ // TODO (@Techassi): This should eventually get replaced by directly using what `kube_derive` offers,
87+ // but that requires an upstream restructure I'm planning to do soon(ish).
88+ #[ derive( Clone , Debug , FromMeta ) ]
89+ pub struct Scale {
90+ pub spec_replicas_path : String ,
91+ pub status_replicas_path : String ,
92+
93+ #[ darling( default ) ]
94+ pub label_selector_path : Option < String > ,
95+ }
0 commit comments