Backward compatibility for sticky

This commit is contained in:
Ludovic Fernandez 2017-10-16 17:38:03 +02:00 committed by Traefiker
parent 3afd6024b5
commit 08503655d9
22 changed files with 140 additions and 260 deletions

View file

@ -1060,24 +1060,10 @@ func TestDockerHasStickinessLabel(t *testing.T) {
expected bool
}{
{
desc: "no sticky/stickiness-label",
desc: "no stickiness-label",
container: containerJSON(),
expected: false,
},
{
desc: "sticky true",
container: containerJSON(labels(map[string]string{
types.LabelBackendLoadbalancerSticky: "true",
})),
expected: true,
},
{
desc: "sticky false",
container: containerJSON(labels(map[string]string{
types.LabelBackendLoadbalancerSticky: "false",
})),
expected: false,
},
{
desc: "stickiness true",
container: containerJSON(labels(map[string]string{
@ -1092,30 +1078,6 @@ func TestDockerHasStickinessLabel(t *testing.T) {
})),
expected: false,
},
{
desc: "sticky true + stickiness false",
container: containerJSON(labels(map[string]string{
types.LabelBackendLoadbalancerSticky: "true",
types.LabelBackendLoadbalancerStickiness: "false",
})),
expected: true,
},
{
desc: "sticky false + stickiness true",
container: containerJSON(labels(map[string]string{
types.LabelBackendLoadbalancerSticky: "false",
types.LabelBackendLoadbalancerStickiness: "true",
})),
expected: true,
},
{
desc: "sticky false + stickiness false",
container: containerJSON(labels(map[string]string{
types.LabelBackendLoadbalancerSticky: "false",
types.LabelBackendLoadbalancerStickiness: "false",
})),
expected: false,
},
}
for _, test := range testCases {