Skip to content

Commit 9a997c3

Browse files
p0lyn0mialopenshift-cherrypick-robot
authored andcommitted
webhooksupportabilitycontroller: log the name of the webhook on dial errors
1 parent 71e4eed commit 9a997c3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pkg/operator/webhooksupportabilitycontroller/degraded_webhook.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ func (c *webhookSupportabilityController) updateWebhookConfigurationDegraded(ctx
4949
serviceMsgs = append(serviceMsgs, msg)
5050
continue
5151
}
52-
err = c.assertConnect(ctx, webhook.Service, webhook.CABundle)
52+
err = c.assertConnect(ctx, webhook.Name, webhook.Service, webhook.CABundle)
5353
if err != nil {
5454
msg := fmt.Sprintf("%s: %s", webhook.Name, err)
5555
if webhook.FailurePolicyIsIgnore {
@@ -94,7 +94,7 @@ func (c *webhookSupportabilityController) assertService(reference *serviceRefere
9494
}
9595

9696
// assertConnect performs a dns lookup of service, opens a tcp connection, and performs a tls handshake.
97-
func (c *webhookSupportabilityController) assertConnect(ctx context.Context, reference *serviceReference, caBundle []byte) error {
97+
func (c *webhookSupportabilityController) assertConnect(ctx context.Context, webhookName string, reference *serviceReference, caBundle []byte) error {
9898
host := reference.Name + "." + reference.Namespace + ".svc"
9999
port := "443"
100100
if reference.Port != nil {
@@ -125,7 +125,7 @@ func (c *webhookSupportabilityController) assertConnect(ctx context.Context, ref
125125
if err != nil {
126126
if i != 2 {
127127
// log err since only last one is reported
128-
runtime.HandleError(err)
128+
runtime.HandleError(fmt.Errorf("%s: %v", webhookName, err))
129129
}
130130
continue
131131
}

0 commit comments

Comments
 (0)