From bdbfad8a8ac63913209d156de0c47c7887206cd5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?brother-=E6=88=8E?= Date: Thu, 22 Aug 2024 09:59:55 +0800 Subject: [PATCH] fix: fix up kingress controller NPE (#1235) --- pkg/ingress/kube/kingress/controller.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/ingress/kube/kingress/controller.go b/pkg/ingress/kube/kingress/controller.go index 7bd40810e..906ee162f 100644 --- a/pkg/ingress/kube/kingress/controller.go +++ b/pkg/ingress/kube/kingress/controller.go @@ -163,7 +163,6 @@ func (c *controller) processNextWorkItem() bool { func (c *controller) onEvent(namespacedName types.NamespacedName) error { event := model.EventUpdate ing, err := c.ingressLister.Ingresses(namespacedName.Namespace).Get(namespacedName.Name) - ing.Status.InitializeConditions() if err != nil { if kerrors.IsNotFound(err) { event = model.EventDelete @@ -181,6 +180,8 @@ func (c *controller) onEvent(namespacedName types.NamespacedName) error { return nil } + ing.Status.InitializeConditions() + // we should check need process only when event is not delete, // if it is delete event, and previously processed, we need to process too. if event != model.EventDelete {