From 6eb1ffffdf78945272b737cb43d2cfc7750dba72 Mon Sep 17 00:00:00 2001 From: James Strong Date: Tue, 31 Jan 2023 18:18:38 -0500 Subject: [PATCH] Adding else per pr comments Signed-off-by: James Strong --- pkg/util/ingress/ingress.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/pkg/util/ingress/ingress.go b/pkg/util/ingress/ingress.go index 800db3306..acadad432 100644 --- a/pkg/util/ingress/ingress.go +++ b/pkg/util/ingress/ingress.go @@ -295,10 +295,12 @@ func checkPath(paths []networkingv1.HTTPIngressPath, enablePathTypeValidation bo return fmt.Errorf("path %s of type %s contains invalid characters", path.Path, *path.PathType) } continue - } - //path validation is disabled, so we check what regex chars are allowed by user - if !regexSpecificChars.MatchString(path.Path) { - return fmt.Errorf("path %s of type %s contains invalid characters", path.Path, *path.PathType) + } else { + //path validation is disabled, so we check what regex chars are allowed by user + if !regexSpecificChars.MatchString(path.Path) { + return fmt.Errorf("path %s of type %s contains invalid characters", path.Path, *path.PathType) + } + continue } default: