From f9cffb2d62c49c6c519ab7d56ae9be29836963d7 Mon Sep 17 00:00:00 2001 From: Jiahui-Wang Date: Mon, 13 Feb 2023 17:01:43 +0800 Subject: [PATCH 1/2] should ignore ingress if the old ingress class annotation and the new are not equal to the expected by Ingress Controller --- internal/ingress/controller/store/store.go | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/internal/ingress/controller/store/store.go b/internal/ingress/controller/store/store.go index 13af28137..809bb5429 100644 --- a/internal/ingress/controller/store/store.go +++ b/internal/ingress/controller/store/store.go @@ -466,11 +466,14 @@ func New( var errOld, errCur error var classCur string - if !icConfig.IgnoreIngressClass { - _, errOld = store.GetIngressClass(oldIng, icConfig) - classCur, errCur = store.GetIngressClass(curIng, icConfig) - } - if errOld != nil && errCur == nil { + + _, errOld = store.GetIngressClass(oldIng, icConfig) + classCur, errCur = store.GetIngressClass(curIng, icConfig) + + if errCur != nil && errOld != nil { + klog.InfoS("Ignoring ingress because of error while validating ingress class", "ingress", klog.KObj(curIng), "error", errCur) + return + } else if errOld != nil && errCur == nil { if hasCatchAllIngressRule(curIng.Spec) && disableCatchAll { klog.InfoS("ignoring update for catch-all ingress because of --disable-catch-all", "ingress", klog.KObj(curIng)) return From a3f4a6f9452a2551692ff037bb3fde2922c6ffab Mon Sep 17 00:00:00 2001 From: jiahui Date: Fri, 17 Feb 2023 23:31:42 +0800 Subject: [PATCH 2/2] add user id for easyCLA check --- internal/ingress/controller/store/store.go | 1 - 1 file changed, 1 deletion(-) diff --git a/internal/ingress/controller/store/store.go b/internal/ingress/controller/store/store.go index 6eb314926..2918bd161 100644 --- a/internal/ingress/controller/store/store.go +++ b/internal/ingress/controller/store/store.go @@ -465,7 +465,6 @@ func New( var errOld, errCur error var classCur string - _, errOld = store.GetIngressClass(oldIng, icConfig) classCur, errCur = store.GetIngressClass(curIng, icConfig)