Deny catch-all ingress when DisableCatchAll is set
This commit is contained in:
parent
2503b23b09
commit
8f7fecab17
2 changed files with 26 additions and 0 deletions
|
|
@ -224,6 +224,10 @@ func (n *NGINXController) CheckIngress(ing *networking.Ingress) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
if n.cfg.DisableCatchAll && ing.Spec.Backend != nil {
|
||||
return fmt.Errorf("This deployment is trying to create a catch-all ingress while DisableCatchAll flag is set to true. Remove '.spec.backend' or set DisableCatchAll flag to false.")
|
||||
}
|
||||
|
||||
if parser.AnnotationsPrefix != parser.DefaultAnnotationsPrefix {
|
||||
for key := range ing.ObjectMeta.GetAnnotations() {
|
||||
if strings.HasPrefix(key, fmt.Sprintf("%s/", parser.DefaultAnnotationsPrefix)) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue