11use std:: sync:: Arc ;
22
3- use restarter_mutate_sts:: { add_sts_restarter_annotation, get_mutating_webhook_configuration} ;
3+ use restarter_mutate_sts:: {
4+ add_sts_restarter_annotations_handler, get_sts_restarter_mutating_webhook_configuration,
5+ } ;
46use snafu:: { ResultExt , Snafu } ;
57use stackable_operator:: {
68 cli:: OperatorEnvironmentOptions ,
79 kube:: Client ,
810 webhook:: {
9- WebhookError , WebhookOptions , WebhookServer ,
10- servers :: { MutatingWebhookServer , WebhookServerImplementation } ,
11+ WebhookServer , WebhookServerError , WebhookServerOptions ,
12+ webhooks :: { MutatingWebhook , Webhook } ,
1113 } ,
1214} ;
1315
@@ -18,7 +20,7 @@ mod restarter_mutate_sts;
1820#[ derive( Debug , Snafu ) ]
1921pub enum Error {
2022 #[ snafu( display( "failed to create webhook server" ) ) ]
21- CreateWebhookServer { source : WebhookError } ,
23+ CreateWebhookServer { source : WebhookServerError } ,
2224}
2325
2426pub async fn create_webhook_server (
@@ -27,22 +29,22 @@ pub async fn create_webhook_server(
2729 disable_restarter_mutating_webhook : bool ,
2830 client : Client ,
2931) -> Result < WebhookServer , Error > {
30- let mut webhooks: Vec < Box < dyn WebhookServerImplementation > > = vec ! [ ] ;
32+ let mut webhooks: Vec < Box < dyn Webhook > > = vec ! [ ] ;
3133 if !disable_restarter_mutating_webhook {
32- webhooks. push ( Box :: new ( MutatingWebhookServer :: new (
33- get_mutating_webhook_configuration ( ) ,
34- add_sts_restarter_annotation ,
34+ webhooks. push ( Box :: new ( MutatingWebhook :: new (
35+ get_sts_restarter_mutating_webhook_configuration ( ) ,
36+ add_sts_restarter_annotations_handler ,
3537 ctx,
3638 disable_restarter_mutating_webhook,
3739 client,
3840 FIELD_MANAGER . to_owned ( ) ,
3941 ) ) ) ;
4042 }
4143
42- let webhook_options = WebhookOptions {
44+ let webhook_options = WebhookServerOptions {
4345 socket_addr : WebhookServer :: DEFAULT_SOCKET_ADDRESS ,
44- operator_namespace : operator_environment. operator_namespace . to_owned ( ) ,
45- operator_service_name : operator_environment. operator_service_name . to_owned ( ) ,
46+ webhook_namespace : operator_environment. operator_namespace . to_owned ( ) ,
47+ webhook_service_name : operator_environment. operator_service_name . to_owned ( ) ,
4648 } ;
4749 WebhookServer :: new ( webhook_options, webhooks)
4850 . await
0 commit comments