diff --git a/internal/ingress/annotations/satisfy/main.go b/internal/ingress/annotations/satisfy/main.go index 531335636f..b338df03d7 100644 --- a/internal/ingress/annotations/satisfy/main.go +++ b/internal/ingress/annotations/satisfy/main.go @@ -35,8 +35,9 @@ func NewParser(r resolver.Resolver) parser.IngressAnnotation { // Parse parses annotation contained in the ingress func (s satisfy) Parse(ing *extensions.Ingress) (interface{}, error) { satisfy, err := parser.GetStringAnnotation("satisfy", ing) - if err != nil || satisfy != "any" { - satisfy = "all" + + if err != nil || (satisfy != "any" && satisfy != "all") { + satisfy = "" } return satisfy, nil diff --git a/internal/ingress/annotations/satisfy/main_test.go b/internal/ingress/annotations/satisfy/main_test.go index 52389825a6..6dc7c18918 100644 --- a/internal/ingress/annotations/satisfy/main_test.go +++ b/internal/ingress/annotations/satisfy/main_test.go @@ -69,7 +69,8 @@ func TestSatisfyParser(t *testing.T) { data := map[string]string{ "any": "any", "all": "all", - "invalid": "all", + "invalid": "", + "": "", } annotations := map[string]string{} diff --git a/test/e2e/annotations/satisfy.go b/test/e2e/annotations/satisfy.go index faf80d2521..3c91e1dce3 100644 --- a/test/e2e/annotations/satisfy.go +++ b/test/e2e/annotations/satisfy.go @@ -43,15 +43,13 @@ var _ = framework.IngressNginxDescribe("Annotations - SATISFY", func() { annotationKey := "nginx.ingress.kubernetes.io/satisfy" annotations := map[string]string{ - "any": "any", - "all": "all", - "invalid": "all", + "any": "any", + "all": "all", } results := map[string]string{ - "any": "satisfy any", - "all": "satisfy all", - "invalid": "satisfy all", + "any": "satisfy any", + "all": "satisfy all", } initAnnotations := map[string]string{