@@ -17,15 +17,15 @@ use serde::{Serialize, de::DeserializeOwned};
1717use snafu:: { ResultExt , Snafu } ;
1818use x509_cert:: Certificate ;
1919
20- use super :: { WebhookServerImplementation , WebhookServerImplementationError } ;
21- use crate :: WebhookOptions ;
20+ use super :: { Webhook , WebhookError } ;
21+ use crate :: WebhookServerOptions ;
2222
2323#[ derive( Debug , Snafu ) ]
2424pub enum MutatingWebhookError {
25- #[ snafu( display( "failed to patch MutatingWebhookConfiguration {vwc_name :?}" ) ) ]
25+ #[ snafu( display( "failed to patch MutatingWebhookConfiguration {mwc_name :?}" ) ) ]
2626 PatchMutatingWebhookConfiguration {
2727 source : kube:: Error ,
28- vwc_name : String ,
28+ mwc_name : String ,
2929 } ,
3030}
3131
@@ -99,11 +99,11 @@ pub enum MutatingWebhookError {
9999/// AdmissionResponse::from(&request)
100100/// }
101101/// ```
102- pub struct MutatingWebhookServer < H , S , R > {
102+ pub struct MutatingWebhook < H , S , R > {
103103 mutating_webhook_configuration : MutatingWebhookConfiguration ,
104104 handler : H ,
105105 handler_state : Arc < S > ,
106- resource : PhantomData < R > ,
106+ _resource : PhantomData < R > ,
107107
108108 disable_mutating_webhook_configuration_maintenance : bool ,
109109 client : Client ,
@@ -112,7 +112,7 @@ pub struct MutatingWebhookServer<H, S, R> {
112112 field_manager : String ,
113113}
114114
115- impl < H , S , R > MutatingWebhookServer < H , S , R > {
115+ impl < H , S , R > MutatingWebhook < H , S , R > {
116116 /// All webhooks need to set the admissionReviewVersions to `["v1"]`, as this mutating webhook
117117 /// only supports that version! A failure to do so will result in a panic.
118118 pub fn new (
@@ -135,7 +135,7 @@ impl<H, S, R> MutatingWebhookServer<H, S, R> {
135135 mutating_webhook_configuration,
136136 handler,
137137 handler_state,
138- resource : PhantomData ,
138+ _resource : PhantomData ,
139139 disable_mutating_webhook_configuration_maintenance,
140140 client,
141141 field_manager,
@@ -148,7 +148,7 @@ impl<H, S, R> MutatingWebhookServer<H, S, R> {
148148}
149149
150150#[ async_trait]
151- impl < H , S , R , Fut > WebhookServerImplementation for MutatingWebhookServer < H , S , R >
151+ impl < H , S , R , Fut > Webhook for MutatingWebhook < H , S , R >
152152where
153153 H : Fn ( Arc < S > , AdmissionRequest < R > ) -> Fut + Clone + Send + Sync + ' static ,
154154 Fut : Future < Output = AdmissionResponse > + Send + ' static ,
@@ -182,16 +182,16 @@ where
182182 & mut self ,
183183 _new_certificate : & Certificate ,
184184 new_ca_bundle : & ByteString ,
185- options : & WebhookOptions ,
186- ) -> Result < ( ) , WebhookServerImplementationError > {
185+ options : & WebhookServerOptions ,
186+ ) -> Result < ( ) , WebhookError > {
187187 if self . disable_mutating_webhook_configuration_maintenance {
188188 return Ok ( ( ) ) ;
189189 }
190190
191191 let mut mutating_webhook_configuration = self . mutating_webhook_configuration . clone ( ) ;
192- let vwc_name = mutating_webhook_configuration. name_any ( ) ;
192+ let mwc_name = mutating_webhook_configuration. name_any ( ) ;
193193 tracing:: info!(
194- k8s. MutatingWebhookConfiguration . name = vwc_name ,
194+ k8s. mutatingwebhookconfiguration . name = mwc_name ,
195195 "reconciling mutating webhook configurations"
196196 ) ;
197197
@@ -210,15 +210,15 @@ where
210210 } ;
211211 }
212212
213- let vwc_api : Api < MutatingWebhookConfiguration > = Api :: all ( self . client . clone ( ) ) ;
213+ let mwc_api : Api < MutatingWebhookConfiguration > = Api :: all ( self . client . clone ( ) ) ;
214214 // Other than with the CRDs we don't need to force-apply the MutatingWebhookConfiguration
215215 let patch = Patch :: Apply ( & mutating_webhook_configuration) ;
216216 let patch_params = PatchParams :: apply ( & self . field_manager ) ;
217217
218- vwc_api
219- . patch ( & vwc_name , & patch_params, & patch)
218+ mwc_api
219+ . patch ( & mwc_name , & patch_params, & patch)
220220 . await
221- . with_context ( |_| PatchMutatingWebhookConfigurationSnafu { vwc_name } ) ?;
221+ . with_context ( |_| PatchMutatingWebhookConfigurationSnafu { mwc_name } ) ?;
222222
223223 Ok ( ( ) )
224224 }
0 commit comments