Change sanitization message from error to warning (#7963)

Signed-off-by: Ricardo Pchevuzinske Katz <ricardo.katz@gmail.com>
This commit is contained in:
Ricardo Katz 2021-11-23 18:25:20 -03:00 committed by GitHub
parent d4a6ade65f
commit c0814c6f78
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 3 deletions

View file

@ -246,7 +246,6 @@ func (n *NGINXController) CheckIngress(ing *networking.Ingress) error {
if cfg.AnnotationValueWordBlocklist != "" {
arrayBadWords = strings.Split(strings.TrimSpace(cfg.AnnotationValueWordBlocklist), ",")
klog.Warningf("Blocklist is %s", cfg.AnnotationValueWordBlocklist)
}
for key, value := range ing.ObjectMeta.GetAnnotations() {
@ -260,7 +259,6 @@ func (n *NGINXController) CheckIngress(ing *networking.Ingress) error {
if strings.HasPrefix(key, fmt.Sprintf("%s/", parser.AnnotationsPrefix)) && len(arrayBadWords) != 0 {
for _, forbiddenvalue := range arrayBadWords {
if strings.Contains(value, strings.TrimSpace(forbiddenvalue)) {
klog.Errorf("%s annotation contains invalid word %s", key, forbiddenvalue)
return fmt.Errorf("%s annotation contains invalid word %s", key, forbiddenvalue)
}
}

View file

@ -825,7 +825,7 @@ func (s *k8sStore) syncIngress(ing *networkingv1.Ingress) {
if s.backendConfig.AnnotationValueWordBlocklist != "" {
if err := checkBadAnnotationValue(copyIng.Annotations, s.backendConfig.AnnotationValueWordBlocklist); err != nil {
klog.Errorf("skipping ingress %s: %s", key, err)
klog.Warningf("skipping ingress %s: %s", key, err)
return
}
}