From 03fefa7521122922fe92a1608ad7388b3f6db7df Mon Sep 17 00:00:00 2001 From: Travis Raines Date: Thu, 20 Aug 2020 14:32:35 -0700 Subject: [PATCH] test: check both default and non-default classes Use both the default ingress class and an arbitrary non-default ingress class when testing annotations. This confirms that annotation handling has no special cases for the default class. --- .../ingress/annotations/annotations_test.go | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/internal/ingress/annotations/annotations_test.go b/internal/ingress/annotations/annotations_test.go index 04a6759c26..655f49c860 100644 --- a/internal/ingress/annotations/annotations_test.go +++ b/internal/ingress/annotations/annotations_test.go @@ -33,15 +33,22 @@ func TestIngressClassValidatorFunc(t *testing.T) { isValid bool // the expected verdict }{ {"", false, "", true}, - {"", false, "kong", true}, - {"", true, "kong", false}, - {"kong", false, "kong", true}, - {"kong", true, "kong", true}, + {"", false, DefaultIngressClass, true}, + {"", true, DefaultIngressClass, false}, + {DefaultIngressClass, false, DefaultIngressClass, true}, + {DefaultIngressClass, true, DefaultIngressClass, true}, {"custom", false, "custom", true}, {"", false, "killer", true}, - {"custom", false, "kong", false}, - {"custom", true, "kong", false}, + {"custom", false, DefaultIngressClass, false}, + {"custom", true, DefaultIngressClass, false}, {"", true, "custom", false}, + {"", false, "kozel", true}, + {"", true, "kozel", false}, + {"kozel", false, "kozel", true}, + {"kozel", true, "kozel", true}, + {"", false, "killer", true}, + {"custom", false, "kozel", false}, + {"custom", true, "kozel", false}, } ing := &extensions.Ingress{