Merge pull request #3822 from Shopify/satisfy-default-remove

Set default for satisfy annotation to nothing
This commit is contained in:
Kubernetes Prow Robot 2019-02-27 06:13:06 -08:00 committed by GitHub
commit a1b2e132e5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 9 deletions

View file

@ -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

View file

@ -69,7 +69,8 @@ func TestSatisfyParser(t *testing.T) {
data := map[string]string{
"any": "any",
"all": "all",
"invalid": "all",
"invalid": "",
"": "",
}
annotations := map[string]string{}

View file

@ -45,13 +45,11 @@ var _ = framework.IngressNginxDescribe("Annotations - SATISFY", func() {
annotations := map[string]string{
"any": "any",
"all": "all",
"invalid": "all",
}
results := map[string]string{
"any": "satisfy any",
"all": "satisfy all",
"invalid": "satisfy all",
}
initAnnotations := map[string]string{