Merge pull request #3822 from Shopify/satisfy-default-remove
Set default for satisfy annotation to nothing
This commit is contained in:
commit
a1b2e132e5
3 changed files with 9 additions and 9 deletions
|
@ -35,8 +35,9 @@ func NewParser(r resolver.Resolver) parser.IngressAnnotation {
|
||||||
// Parse parses annotation contained in the ingress
|
// Parse parses annotation contained in the ingress
|
||||||
func (s satisfy) Parse(ing *extensions.Ingress) (interface{}, error) {
|
func (s satisfy) Parse(ing *extensions.Ingress) (interface{}, error) {
|
||||||
satisfy, err := parser.GetStringAnnotation("satisfy", ing)
|
satisfy, err := parser.GetStringAnnotation("satisfy", ing)
|
||||||
if err != nil || satisfy != "any" {
|
|
||||||
satisfy = "all"
|
if err != nil || (satisfy != "any" && satisfy != "all") {
|
||||||
|
satisfy = ""
|
||||||
}
|
}
|
||||||
|
|
||||||
return satisfy, nil
|
return satisfy, nil
|
||||||
|
|
|
@ -69,7 +69,8 @@ func TestSatisfyParser(t *testing.T) {
|
||||||
data := map[string]string{
|
data := map[string]string{
|
||||||
"any": "any",
|
"any": "any",
|
||||||
"all": "all",
|
"all": "all",
|
||||||
"invalid": "all",
|
"invalid": "",
|
||||||
|
"": "",
|
||||||
}
|
}
|
||||||
|
|
||||||
annotations := map[string]string{}
|
annotations := map[string]string{}
|
||||||
|
|
|
@ -43,15 +43,13 @@ var _ = framework.IngressNginxDescribe("Annotations - SATISFY", func() {
|
||||||
annotationKey := "nginx.ingress.kubernetes.io/satisfy"
|
annotationKey := "nginx.ingress.kubernetes.io/satisfy"
|
||||||
|
|
||||||
annotations := map[string]string{
|
annotations := map[string]string{
|
||||||
"any": "any",
|
"any": "any",
|
||||||
"all": "all",
|
"all": "all",
|
||||||
"invalid": "all",
|
|
||||||
}
|
}
|
||||||
|
|
||||||
results := map[string]string{
|
results := map[string]string{
|
||||||
"any": "satisfy any",
|
"any": "satisfy any",
|
||||||
"all": "satisfy all",
|
"all": "satisfy all",
|
||||||
"invalid": "satisfy all",
|
|
||||||
}
|
}
|
||||||
|
|
||||||
initAnnotations := map[string]string{
|
initAnnotations := map[string]string{
|
||||||
|
|
Loading…
Reference in a new issue