@@ -7,6 +7,7 @@ use stackable_operator::{
77 webhooks:: { ConversionWebhook , ConversionWebhookOptions } ,
88 } ,
99} ;
10+ use tokio:: sync:: oneshot;
1011
1112use crate :: crd:: { AirflowCluster , AirflowClusterVersion , FIELD_MANAGER } ;
1213
@@ -26,7 +27,7 @@ pub async fn create_webhook_server(
2627 operator_environment : & OperatorEnvironmentOptions ,
2728 disable_crd_maintenance : bool ,
2829 client : Client ,
29- ) -> Result < WebhookServer , Error > {
30+ ) -> Result < ( WebhookServer , oneshot :: Receiver < ( ) > ) , Error > {
3031 let crds_and_handlers = vec ! [ (
3132 AirflowCluster :: merged_crd( AirflowClusterVersion :: V1Alpha2 ) . context( MergeCrdSnafu ) ?,
3233 AirflowCluster :: try_convert,
@@ -37,7 +38,7 @@ pub async fn create_webhook_server(
3738 field_manager : FIELD_MANAGER . to_owned ( ) ,
3839 } ;
3940
40- let ( conversion_webhook, _initial_reconcile_rx ) =
41+ let ( conversion_webhook, initial_reconcile_rx ) =
4142 ConversionWebhook :: new ( crds_and_handlers, client, conversion_webhook_options) ;
4243
4344 let webhook_server_options = WebhookServerOptions {
@@ -46,7 +47,10 @@ pub async fn create_webhook_server(
4647 webhook_service_name : operator_environment. operator_service_name . to_owned ( ) ,
4748 } ;
4849
49- WebhookServer :: new ( vec ! [ Box :: new( conversion_webhook) ] , webhook_server_options)
50- . await
51- . context ( CreateWebhookSnafu )
50+ let webhook_server =
51+ WebhookServer :: new ( vec ! [ Box :: new( conversion_webhook) ] , webhook_server_options)
52+ . await
53+ . context ( CreateWebhookSnafu ) ?;
54+
55+ Ok ( ( webhook_server, initial_reconcile_rx) )
5256}
0 commit comments