From eeead4ec10b5740ae147d635c24c9413d0d4ef55 Mon Sep 17 00:00:00 2001 From: Lukasz Szaszkiewicz Date: Wed, 24 Jan 2024 14:38:12 +0100 Subject: [PATCH] webhook/controller: when skipping a check because of missing CA log the name of the webhook --- .../webhooksupportabilitycontroller/degraded_webhook.go | 2 +- .../degraded_webhook_admission_test.go | 4 ++-- .../degraded_webhook_conversion_test.go | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/operator/webhooksupportabilitycontroller/degraded_webhook.go b/pkg/operator/webhooksupportabilitycontroller/degraded_webhook.go index afbf87f9fa..40091288fd 100644 --- a/pkg/operator/webhooksupportabilitycontroller/degraded_webhook.go +++ b/pkg/operator/webhooksupportabilitycontroller/degraded_webhook.go @@ -116,7 +116,7 @@ func (c *webhookSupportabilityController) assertConnect(ctx context.Context, web if len(caBundle) > 0 { rootCAs.AppendCertsFromPEM(caBundle) } else if caBundleProvidedByServiceCA { - err := fmt.Errorf("skipping checking the webhook via %q service because the caBundle (provided by the service-ca-operator) is empty. Please check the service-ca's logs if the issue persists", net.JoinHostPort(host, port)) + err := fmt.Errorf("skipping checking the webhook %q via %q service because the caBundle (provided by the service-ca-operator) is empty. Please check the service-ca's logs if the issue persists", webhookName, net.JoinHostPort(host, port)) return err } timeout := 10 * time.Second diff --git a/pkg/operator/webhooksupportabilitycontroller/degraded_webhook_admission_test.go b/pkg/operator/webhooksupportabilitycontroller/degraded_webhook_admission_test.go index 1317ac28de..fa882fd8cc 100644 --- a/pkg/operator/webhooksupportabilitycontroller/degraded_webhook_admission_test.go +++ b/pkg/operator/webhooksupportabilitycontroller/degraded_webhook_admission_test.go @@ -197,7 +197,7 @@ func TestUpdateMutatingAdmissionWebhookConfigurationDegraded(t *testing.T) { Type: MutatingAdmissionWebhookConfigurationErrorType, Status: operatorv1.ConditionTrue, Reason: WebhookServiceConnectionErrorReason, - Message: `mw10: skipping checking the webhook via \"([^"]+)\" service because the caBundle \(provided by the service-ca-operator\) is empty. Please check the service-ca's logs if the issue persists`, + Message: `mw10: skipping checking the webhook \"mw10\" via \"([^"]+)\" service because the caBundle \(provided by the service-ca-operator\) is empty. Please check the service-ca's logs if the issue persists`, }, }, } @@ -424,7 +424,7 @@ func TestUpdateValidatingAdmissionWebhookConfigurationDegradedStatus(t *testing. Type: ValidatingAdmissionWebhookConfigurationErrorType, Status: operatorv1.ConditionTrue, Reason: WebhookServiceConnectionErrorReason, - Message: `mw10: skipping checking the webhook via \"([^"]+)\" service because the caBundle \(provided by the service-ca-operator\) is empty. Please check the service-ca's logs if the issue persists`, + Message: `mw10: skipping checking the webhook \"mw10\" via \"([^"]+)\" service because the caBundle \(provided by the service-ca-operator\) is empty. Please check the service-ca's logs if the issue persists`, }, }, } diff --git a/pkg/operator/webhooksupportabilitycontroller/degraded_webhook_conversion_test.go b/pkg/operator/webhooksupportabilitycontroller/degraded_webhook_conversion_test.go index ef9e0a828e..96ad362599 100644 --- a/pkg/operator/webhooksupportabilitycontroller/degraded_webhook_conversion_test.go +++ b/pkg/operator/webhooksupportabilitycontroller/degraded_webhook_conversion_test.go @@ -165,7 +165,7 @@ func TestUpdateCRDConversionWebhookConfigurationDegraded(t *testing.T) { Type: CRDConversionWebhookConfigurationErrorType, Status: operatorv1.ConditionTrue, Reason: WebhookServiceConnectionErrorReason, - Message: `crd10: skipping checking the webhook via \"([^"]+)\" service because the caBundle \(provided by the service-ca-operator\) is empty. Please check the service-ca's logs if the issue persists`, + Message: `crd10: skipping checking the webhook \"crd10\" via \"([^"]+)\" service because the caBundle \(provided by the service-ca-operator\) is empty. Please check the service-ca's logs if the issue persists`, }, }, }