From 5ad4280c0941019664734834182e07ac2cc9c6bf Mon Sep 17 00:00:00 2001 From: Morten Torkildsen Date: Sun, 28 Feb 2021 19:43:25 -0800 Subject: [PATCH] Avoid sending events for every non-conformant pod in disruption controller --- pkg/controller/disruption/disruption.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/pkg/controller/disruption/disruption.go b/pkg/controller/disruption/disruption.go index d7d02c679a1..99cf4ecfa22 100644 --- a/pkg/controller/disruption/disruption.go +++ b/pkg/controller/disruption/disruption.go @@ -49,10 +49,9 @@ import ( "k8s.io/client-go/tools/cache" "k8s.io/client-go/tools/record" "k8s.io/client-go/util/workqueue" + "k8s.io/klog/v2" podutil "k8s.io/kubernetes/pkg/api/v1/pod" "k8s.io/kubernetes/pkg/controller" - - "k8s.io/klog/v2" ) // DeletionTimeout sets maximum time from the moment a pod is added to DisruptedPods in PDB.Status @@ -679,7 +678,6 @@ func (dc *DisruptionController) getExpectedScale(pdb *policy.PodDisruptionBudget controllerRef := metav1.GetControllerOf(pod) if controllerRef == nil { err = fmt.Errorf("found no controller ref for pod %q", pod.Name) - dc.recorder.Event(pdb, v1.EventTypeWarning, "NoControllerRef", err.Error()) return } @@ -704,7 +702,6 @@ func (dc *DisruptionController) getExpectedScale(pdb *policy.PodDisruptionBudget } if !foundController { err = fmt.Errorf("found no controllers for pod %q", pod.Name) - dc.recorder.Event(pdb, v1.EventTypeWarning, "NoControllers", err.Error()) return } }