1
0
Fork 0

Adds Docker provider support

Co-authored-by: Julien Salleyron <julien@containo.us>
This commit is contained in:
Ludovic Fernandez 2019-01-18 15:18:04 +01:00 committed by Traefiker Bot
parent 8735263930
commit b54c956c5e
78 changed files with 3476 additions and 5587 deletions

View file

@ -18,15 +18,13 @@ func TestDecodeToNode(t *testing.T) {
testCases := []struct {
desc string
in map[string]string
filters []string
expected expected
}{
{
desc: "level 0",
in: map[string]string{"traefik": "bar"},
expected: expected{node: &Node{
Name: "traefik",
Value: "bar",
}},
desc: "no label",
in: map[string]string{},
expected: expected{node: nil},
},
{
desc: "level 1",
@ -75,6 +73,20 @@ func TestDecodeToNode(t *testing.T) {
},
expected: expected{error: true},
},
{
desc: "several entries, prefix filter",
in: map[string]string{
"traefik.foo": "bar",
"traefik.fii": "bir",
},
filters: []string{"traefik.Foo"},
expected: expected{node: &Node{
Name: "traefik",
Children: []*Node{
{Name: "foo", Value: "bar"},
},
}},
},
{
desc: "several entries, level 1",
in: map[string]string{
@ -172,7 +184,7 @@ func TestDecodeToNode(t *testing.T) {
t.Run(test.desc, func(t *testing.T) {
t.Parallel()
out, err := DecodeToNode(test.in)
out, err := DecodeToNode(test.in, test.filters...)
if test.expected.error {
require.Error(t, err)