@@ -785,7 +785,7 @@ func TestServerSideApplyWithDefaulting(t *testing.T) {
785
785
// It also calculates and returns the corresponding MutatingWebhookConfiguration.
786
786
// Note: To activate the webhook, the MutatingWebhookConfiguration has to be deployed.
787
787
func setupWebhookWithManager (ns * corev1.Namespace ) (* KubeadmConfigTemplateTestDefaulter , * admissionv1.MutatingWebhookConfiguration , error ) {
788
- webhookServer := env .Manager .GetWebhookServer ()
788
+ webhookServer := env .Manager .GetWebhookServer ().( * webhook. DefaultServer )
789
789
790
790
// Calculate webhook host and path.
791
791
// Note: This is done the same way as in our envtest package.
@@ -802,7 +802,7 @@ func setupWebhookWithManager(ns *corev1.Namespace) (*KubeadmConfigTemplateTestDe
802
802
admission .WithCustomDefaulter (env .Manager .GetScheme (), & bootstrapv1.KubeadmConfigTemplate {}, defaulter ))
803
803
804
804
// Calculate the MutatingWebhookConfiguration
805
- caBundle , err := os .ReadFile (filepath .Join (webhookServer .CertDir , webhookServer .CertName ))
805
+ caBundle , err := os .ReadFile (filepath .Join (webhookServer .Options . CertDir , webhookServer . Options .CertName ))
806
806
if err != nil {
807
807
return nil , nil , err
808
808
}
@@ -816,7 +816,7 @@ func setupWebhookWithManager(ns *corev1.Namespace) (*KubeadmConfigTemplateTestDe
816
816
{
817
817
Name : ns .Name + ".kubeadmconfigtemplate.bootstrap.cluster.x-k8s.io" ,
818
818
ClientConfig : admissionv1.WebhookClientConfig {
819
- URL : pointer .String (fmt .Sprintf ("https://%s%s" , net .JoinHostPort (webhookHost , strconv .Itoa (webhookServer .Port )), webhookPath )),
819
+ URL : pointer .String (fmt .Sprintf ("https://%s%s" , net .JoinHostPort (webhookHost , strconv .Itoa (webhookServer .Options . Port )), webhookPath )),
820
820
CABundle : caBundle ,
821
821
},
822
822
Rules : []admissionv1.RuleWithOperations {
0 commit comments