mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-06 02:34:03 +00:00
Ignore context canceled from validate and mutate webhook failopen metric
This commit is contained in:
parent
1b7fffa0a1
commit
1732b23a34
@ -198,6 +198,10 @@ func (a *mutatingDispatcher) Dispatch(ctx context.Context, attr admission.Attrib
|
||||
}
|
||||
|
||||
if callErr, ok := err.(*webhookutil.ErrCallingWebhook); ok {
|
||||
if ctx.Err() == context.Canceled {
|
||||
klog.Warningf("Context Canceled when calling webhook %v", hook.Name)
|
||||
return err
|
||||
}
|
||||
if ignoreClientCallFailures {
|
||||
klog.Warningf("Failed calling webhook, failing open %v: %v", hook.Name, callErr)
|
||||
admissionmetrics.Metrics.ObserveWebhookFailOpen(ctx, hook.Name, "admit")
|
||||
|
@ -193,6 +193,10 @@ func (d *validatingDispatcher) Dispatch(ctx context.Context, attr admission.Attr
|
||||
}
|
||||
|
||||
if callErr, ok := err.(*webhookutil.ErrCallingWebhook); ok {
|
||||
if ctx.Err() == context.Canceled {
|
||||
klog.Warningf("Context Canceled when calling webhook %v", hook.Name)
|
||||
return
|
||||
}
|
||||
if ignoreClientCallFailures {
|
||||
klog.Warningf("Failed calling webhook, failing open %v: %v", hook.Name, callErr)
|
||||
admissionmetrics.Metrics.ObserveWebhookFailOpen(ctx, hook.Name, "validating")
|
||||
|
Loading…
Reference in New Issue
Block a user