Trim spaces from badword items (#7921)
This commit is contained in:
parent
7d17ff35fa
commit
15567b07c0
3 changed files with 23 additions and 1 deletions
|
|
@ -253,7 +253,7 @@ func (n *NGINXController) CheckIngress(ing *networking.Ingress) error {
|
|||
}
|
||||
if strings.HasPrefix(key, fmt.Sprintf("%s/", parser.AnnotationsPrefix)) {
|
||||
for _, forbiddenvalue := range arraybadWords {
|
||||
if strings.Contains(value, forbiddenvalue) {
|
||||
if strings.Contains(value, strings.TrimSpace(forbiddenvalue)) {
|
||||
return fmt.Errorf("%s annotation contains invalid word %s", key, forbiddenvalue)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue