Skip to content

Commit

Permalink
Merge pull request #3822 from Shopify/satisfy-default-remove
Browse files Browse the repository at this point in the history
Set default for satisfy annotation to nothing
  • Loading branch information
k8s-ci-robot authored Feb 27, 2019
2 parents 166dd1a + 28d99c6 commit a1b2e13
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
5 changes: 3 additions & 2 deletions internal/ingress/annotations/satisfy/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion internal/ingress/annotations/satisfy/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ func TestSatisfyParser(t *testing.T) {
data := map[string]string{
"any": "any",
"all": "all",
"invalid": "all",
"invalid": "",
"": "",
}

annotations := map[string]string{}
Expand Down
10 changes: 4 additions & 6 deletions test/e2e/annotations/satisfy.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down

0 comments on commit a1b2e13

Please sign in to comment.