Skip to content

Commit

Permalink
test: check both default and non-default classes
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Travis Raines committed Aug 20, 2020
1 parent d933951 commit 03fefa7
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions internal/ingress/annotations/annotations_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down

0 comments on commit 03fefa7

Please sign in to comment.