From c0814c6f784e63f08768a935234afc201cf5a5f2 Mon Sep 17 00:00:00 2001 From: Ricardo Katz Date: Tue, 23 Nov 2021 18:25:20 -0300 Subject: [PATCH] Change sanitization message from error to warning (#7963) Signed-off-by: Ricardo Pchevuzinske Katz --- internal/ingress/controller/controller.go | 2 -- internal/ingress/controller/store/store.go | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/internal/ingress/controller/controller.go b/internal/ingress/controller/controller.go index 3c2969c2c9..75c06ad2dd 100644 --- a/internal/ingress/controller/controller.go +++ b/internal/ingress/controller/controller.go @@ -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) } } diff --git a/internal/ingress/controller/store/store.go b/internal/ingress/controller/store/store.go index c76b59bb00..7e9b897358 100644 --- a/internal/ingress/controller/store/store.go +++ b/internal/ingress/controller/store/store.go @@ -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 } }