@@ -22,8 +22,7 @@ use snafu::{ResultExt, Snafu};
2222use tokio:: sync:: oneshot;
2323use tracing:: instrument;
2424
25- use super :: { Webhook , WebhookError } ;
26- use crate :: WebhookServerOptions ;
25+ use crate :: { Webhook , WebhookError , WebhookServerOptions } ;
2726
2827#[ derive( Debug , Snafu ) ]
2928pub enum ConversionWebhookError {
@@ -138,7 +137,7 @@ impl<H> ConversionWebhook<H> {
138137 }
139138
140139 #[ instrument(
141- skip( self , crd, crd_api, new_ca_bundle ) ,
140+ skip( self , crd, crd_api, ca_bundle ) ,
142141 fields(
143142 name = crd. name_any( ) ,
144143 kind = & crd. spec. names. kind
@@ -148,7 +147,7 @@ impl<H> ConversionWebhook<H> {
148147 & self ,
149148 mut crd : CustomResourceDefinition ,
150149 crd_api : & Api < CustomResourceDefinition > ,
151- new_ca_bundle : & ByteString ,
150+ ca_bundle : ByteString ,
152151 options : & WebhookServerOptions ,
153152 ) -> Result < ( ) , WebhookError > {
154153 let crd_kind = & crd. spec . names . kind ;
@@ -178,7 +177,7 @@ impl<H> ConversionWebhook<H> {
178177 port : Some ( options. socket_addr . port ( ) . into ( ) ) ,
179178 } ) ,
180179 // Here, ByteString takes care of encoding the provided content as base64.
181- ca_bundle : Some ( new_ca_bundle . to_owned ( ) ) ,
180+ ca_bundle : Some ( ca_bundle ) ,
182181 url : None ,
183182 } ) ,
184183 } ) ,
@@ -247,15 +246,15 @@ where
247246 self . options . disable_crd_maintenance
248247 }
249248
250- #[ instrument( skip( self , new_ca_bundle ) ) ]
249+ #[ instrument( skip( self , ca_bundle ) ) ]
251250 async fn handle_certificate_rotation (
252251 & mut self ,
253- new_ca_bundle : & ByteString ,
252+ ca_bundle : & ByteString ,
254253 options : & WebhookServerOptions ,
255254 ) -> Result < ( ) , WebhookError > {
256255 let crd_api: Api < CustomResourceDefinition > = Api :: all ( self . client . clone ( ) ) ;
257256 for ( crd, _) in & self . crds_and_handlers {
258- self . reconcile_crd ( crd. clone ( ) , & crd_api, new_ca_bundle , options)
257+ self . reconcile_crd ( crd. clone ( ) , & crd_api, ca_bundle . to_owned ( ) , options)
259258 . await ?;
260259 }
261260
0 commit comments