From 8a2309007256974e186099c44a25732b643381db Mon Sep 17 00:00:00 2001 From: Nikola Jokic Date: Thu, 4 Dec 2025 12:31:52 +0100 Subject: [PATCH] Remove oom --- .../autoscalinglistener_controller.go | 9 ---- .../autoscalinglistener_controller_test.go | 50 ------------------- 2 files changed, 59 deletions(-) diff --git a/controllers/actions.github.com/autoscalinglistener_controller.go b/controllers/actions.github.com/autoscalinglistener_controller.go index 9187729e..4c8ed34a 100644 --- a/controllers/actions.github.com/autoscalinglistener_controller.go +++ b/controllers/actions.github.com/autoscalinglistener_controller.go @@ -246,15 +246,6 @@ func (r *AutoscalingListenerReconciler) Reconcile(ctx context.Context, req ctrl. return ctrl.Result{}, r.deleteListenerPod(ctx, autoscalingListener, listenerPod, log) - case listenerPod.Status.Reason == "OOMKilled": - log.Info( - "Listener pod is OOMKilled", - "phase", listenerPod.Status.Phase, - "reason", listenerPod.Status.Reason, - "message", listenerPod.Status.Message, - ) - - return ctrl.Result{}, r.deleteListenerPod(ctx, autoscalingListener, listenerPod, log) case cs == nil: log.Info("Listener pod is not ready", "namespace", listenerPod.Namespace, "name", listenerPod.Name) return ctrl.Result{}, nil diff --git a/controllers/actions.github.com/autoscalinglistener_controller_test.go b/controllers/actions.github.com/autoscalinglistener_controller_test.go index 7ce9809c..7bc8ce50 100644 --- a/controllers/actions.github.com/autoscalinglistener_controller_test.go +++ b/controllers/actions.github.com/autoscalinglistener_controller_test.go @@ -720,56 +720,6 @@ var _ = Describe("Test AutoScalingListener customization", func() { "Pod should be created", ) }) - - It("Should re-create pod when the listener pod is OOMKilled", func() { - pod := new(corev1.Pod) - Eventually( - func() (string, error) { - err := k8sClient.Get( - ctx, - client.ObjectKey{ - Name: autoscalingListener.Name, - Namespace: autoscalingListener.Namespace, - }, - pod, - ) - if err != nil { - return "", err - } - - return pod.Name, nil - }, - autoscalingListenerTestTimeout, - autoscalingListenerTestInterval, - ).Should(BeEquivalentTo(autoscalingListener.Name), "Pod should be created") - - updated := pod.DeepCopy() - oldPodUID := string(pod.UID) - updated.Status.Reason = "OOMKilled" - err := k8sClient.Status().Update(ctx, updated) - Expect(err).NotTo(HaveOccurred(), "failed to update pod status") - - Eventually( - func() (string, error) { - pod = new(corev1.Pod) - err := k8sClient.Get( - ctx, - client.ObjectKey{ - Name: autoscalingListener.Name, - Namespace: autoscalingListener.Namespace, - }, - pod, - ) - if err != nil { - return "", err - } - - return string(pod.UID), nil - }, - autoscalingListenerTestTimeout, - autoscalingListenerTestInterval, - ).ShouldNot(BeEquivalentTo(oldPodUID), "Pod should be created") - }) }) })