Add 'use regex' annotation to toggle nginx regex location modifier
This commit is contained in:
parent
f56e839134
commit
f29bdc3e8d
10 changed files with 325 additions and 39 deletions
|
|
@ -178,3 +178,20 @@ func TestAppRoot(t *testing.T) {
|
|||
t.Errorf("Unexpected value got in AppRoot")
|
||||
}
|
||||
}
|
||||
|
||||
func TestUseRegex(t *testing.T) {
|
||||
ing := buildIngress()
|
||||
|
||||
data := map[string]string{}
|
||||
data[parser.GetAnnotationWithPrefix("use-regex")] = "true"
|
||||
ing.SetAnnotations(data)
|
||||
|
||||
i, _ := NewParser(mockBackend{redirect: true}).Parse(ing)
|
||||
redirect, ok := i.(*Config)
|
||||
if !ok {
|
||||
t.Errorf("expected a App Context")
|
||||
}
|
||||
if redirect.UseRegex != true {
|
||||
t.Errorf("Unexpected value got in UseRegex")
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue