should ignore ingress if the old ingress class annotation and the new are not equal to the expected by Ingress Controller

This commit is contained in:
Jiahui-Wang 2023-02-13 17:01:43 +08:00
parent 01c9a2bf25
commit f9cffb2d62

View file

@ -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