Fix panic in ingress class validation
If an ingress had no class annotation, nor IngressClassName at all, and an IngressClass resource was created for the ingress-nginx there was a panic when the controller tried to check the IngressClassName of the Ingress.
This commit is contained in:
parent
56a1e82125
commit
7d82903ce9
2 changed files with 46 additions and 17 deletions
|
|
@ -63,5 +63,8 @@ func IsValid(ing *networking.Ingress) bool {
|
|||
}
|
||||
|
||||
// 4. with IngressClass
|
||||
return k8s.IngressClass.Name == *ing.Spec.IngressClassName
|
||||
if ing.Spec.IngressClassName != nil {
|
||||
return k8s.IngressClass.Name == *ing.Spec.IngressClassName
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue