@@ -21,7 +21,6 @@ use stackable_operator::{
2121 kvp:: { Label , LabelExt } ,
2222 shared:: yaml:: SerializeOptions ,
2323 telemetry:: Tracing ,
24- webhook:: servers:: ConversionWebhookServer ,
2524} ;
2625use tokio:: {
2726 signal:: unix:: { SignalKind , signal} ,
@@ -31,7 +30,10 @@ use tokio_stream::wrappers::UnixListenerStream;
3130use tonic:: transport:: Server ;
3231use utils:: { TonicUnixStream , uds_bind_private} ;
3332
34- use crate :: crd:: { SecretClass , SecretClassVersion , TrustStore , TrustStoreVersion , v1alpha2} ;
33+ use crate :: crd:: {
34+ SecretClass , SecretClassVersion , TrustStore , TrustStoreVersion ,
35+ create_conversion_webhook_and_maintainer, v1alpha2,
36+ } ;
3537
3638mod backend;
3739mod crd;
@@ -79,9 +81,9 @@ async fn main() -> anyhow::Result<()> {
7981 let opts = Opts :: parse ( ) ;
8082 match opts. cmd {
8183 stackable_operator:: cli:: Command :: Crd => {
82- SecretClass :: merged_crd ( crd :: SecretClassVersion :: V1Alpha2 ) ?
84+ SecretClass :: merged_crd ( SecretClassVersion :: V1Alpha2 ) ?
8385 . print_yaml_schema ( built_info:: PKG_VERSION , SerializeOptions :: default ( ) ) ?;
84- TrustStore :: merged_crd ( crd :: TrustStoreVersion :: V1Alpha1 ) ?
86+ TrustStore :: merged_crd ( TrustStoreVersion :: V1Alpha1 ) ?
8587 . print_yaml_schema ( built_info:: PKG_VERSION , SerializeOptions :: default ( ) ) ?;
8688 }
8789 stackable_operator:: cli:: Command :: Run ( SecretOperatorRun {
@@ -129,30 +131,13 @@ async fn main() -> anyhow::Result<()> {
129131 let _ = std:: fs:: remove_file ( & csi_endpoint) ;
130132 }
131133
132- // NOTE (@Techassi): This could maybe be moved into a setup function again. For now,
133- // it is here.
134- let crds_and_handlers = [
135- (
136- SecretClass :: merged_crd ( SecretClassVersion :: V1Alpha2 ) ?,
137- SecretClass :: try_convert as fn ( _) -> _ ,
138- ) ,
139- (
140- TrustStore :: merged_crd ( TrustStoreVersion :: V1Alpha1 ) ?,
141- TrustStore :: try_convert as fn ( _) -> _ ,
142- ) ,
143- ] ;
144-
145134 let ( conversion_webhook, crd_maintainer, initial_reconcile_rx) =
146- ConversionWebhookServer :: with_maintainer (
147- crds_and_handlers,
148- & operator_environment. operator_service_name ,
149- & operator_environment. operator_namespace ,
150- FIELD_MANAGER ,
151- maintenance. disable_crd_maintenance ,
135+ create_conversion_webhook_and_maintainer (
136+ & operator_environment,
137+ & maintenance,
152138 client. as_kube_client ( ) ,
153139 )
154- . await
155- . context ( "failed to create conversion webhook server and CRD maintainer" ) ?;
140+ . await ?;
156141
157142 let mut sigterm = signal ( SignalKind :: terminate ( ) ) ?;
158143 let csi_server = Server :: builder ( )
0 commit comments