diff --git a/pkg/config/parser/labels_decode.go b/pkg/config/parser/labels_decode.go index 5f8f508e7..733662849 100644 --- a/pkg/config/parser/labels_decode.go +++ b/pkg/config/parser/labels_decode.go @@ -65,7 +65,7 @@ func decodeToNode(root *Node, path []string, value string) { func containsNode(nodes []*Node, name string) *Node { for _, n := range nodes { - if name == n.Name { + if strings.EqualFold(name, n.Name) { return n } } diff --git a/pkg/config/parser/labels_decode_test.go b/pkg/config/parser/labels_decode_test.go index 267265005..cd854acf7 100644 --- a/pkg/config/parser/labels_decode_test.go +++ b/pkg/config/parser/labels_decode_test.go @@ -117,6 +117,22 @@ func TestDecodeToNode(t *testing.T) { }, }}, }, + { + desc: "several entries, level 2, case insensitive", + in: map[string]string{ + "traefik.foo.aaa": "bar", + "traefik.Foo.bbb": "bur", + }, + expected: expected{node: &Node{ + Name: "traefik", + Children: []*Node{ + {Name: "Foo", Children: []*Node{ + {Name: "bbb", Value: "bur"}, + {Name: "aaa", Value: "bar"}, + }}, + }, + }}, + }, { desc: "several entries, level 2, 3 children", in: map[string]string{