mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-24 20:24:09 +00:00
Retain the test coverage of TestObserveWebhookRejection.
This commit is contained in:
parent
fb23e449ab
commit
ae90e6b9a1
@ -96,7 +96,7 @@ func TestObserveWebhookRejection(t *testing.T) {
|
||||
Metrics.reset()
|
||||
Metrics.ObserveWebhookRejection(context.TODO(), "x", stepAdmit, attr, WebhookRejectionNoError, 500)
|
||||
Metrics.ObserveWebhookRejection(context.TODO(), "x", stepAdmit, attr, WebhookRejectionNoError, 654)
|
||||
Metrics.ObserveWebhookRejection(context.TODO(), "x", stepValidate, attr, WebhookRejectionCallingWebhookError, 0)
|
||||
Metrics.ObserveWebhookRejection(context.TODO(), "x", stepValidate, admission.NewAttributesRecord(nil, nil, kind, "ns", "name", resource, "subresource", admission.Update, &metav1.UpdateOptions{}, false, nil), WebhookRejectionCallingWebhookError, 0)
|
||||
wantLabels := map[string]string{
|
||||
"name": "x",
|
||||
"operation": string(admission.Create),
|
||||
@ -115,7 +115,7 @@ func TestObserveWebhookRejection(t *testing.T) {
|
||||
}
|
||||
wantLabelsCallingWebhookError := map[string]string{
|
||||
"name": "x",
|
||||
"operation": string(admission.Create),
|
||||
"operation": string(admission.Update),
|
||||
"type": "validate",
|
||||
"error_type": "calling_webhook_error",
|
||||
"rejection_code": "0",
|
||||
|
Loading…
Reference in New Issue
Block a user