Remove Deprecated Step 1
This commit is contained in:
parent
1d53077fc7
commit
8627256e74
68 changed files with 168 additions and 1695 deletions
|
@ -4,7 +4,7 @@ import (
|
|||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/containous/flaeg"
|
||||
"github.com/containous/flaeg/parse"
|
||||
"github.com/containous/traefik/provider/label"
|
||||
"github.com/containous/traefik/tls"
|
||||
"github.com/containous/traefik/types"
|
||||
|
@ -77,12 +77,12 @@ func lbMethod(method string) func(*types.Backend) {
|
|||
}
|
||||
}
|
||||
|
||||
func lbSticky() func(*types.Backend) {
|
||||
func lbStickiness() func(*types.Backend) {
|
||||
return func(b *types.Backend) {
|
||||
if b.LoadBalancer == nil {
|
||||
b.LoadBalancer = &types.LoadBalancer{}
|
||||
}
|
||||
b.LoadBalancer.Sticky = true
|
||||
b.LoadBalancer.Stickiness = &types.Stickiness{}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -378,7 +378,7 @@ func limitBurst(burst int64) func(*types.Rate) {
|
|||
|
||||
func limitPeriod(period time.Duration) func(*types.Rate) {
|
||||
return func(rate *types.Rate) {
|
||||
rate.Period = flaeg.Duration(period)
|
||||
rate.Period = parse.Duration(period)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -921,11 +921,6 @@ func getLoadBalancer(service *corev1.Service) *types.LoadBalancer {
|
|||
loadBalancer.Method = "drr"
|
||||
}
|
||||
|
||||
if sticky := service.Annotations[label.TraefikBackendLoadBalancerSticky]; len(sticky) > 0 {
|
||||
log.Warnf("Deprecated configuration found: %s. Please use %s.", label.TraefikBackendLoadBalancerSticky, annotationKubernetesAffinity)
|
||||
loadBalancer.Sticky = strings.EqualFold(strings.TrimSpace(sticky), "true")
|
||||
}
|
||||
|
||||
if stickiness := getStickiness(service); stickiness != nil {
|
||||
loadBalancer.Stickiness = stickiness
|
||||
}
|
||||
|
|
|
@ -8,7 +8,6 @@ import (
|
|||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/containous/traefik/provider/label"
|
||||
"github.com/containous/traefik/tls"
|
||||
"github.com/containous/traefik/types"
|
||||
"github.com/stretchr/testify/assert"
|
||||
|
@ -867,8 +866,7 @@ func TestServiceAnnotations(t *testing.T) {
|
|||
sName("service2"),
|
||||
sNamespace("testing"),
|
||||
sUID("2"),
|
||||
sAnnotation(annotationKubernetesCircuitBreakerExpression, ""),
|
||||
sAnnotation(label.TraefikBackendLoadBalancerSticky, "true"),
|
||||
sAnnotation(annotationKubernetesAffinity, "true"),
|
||||
sSpec(
|
||||
clusterIP("10.0.0.2"),
|
||||
sPorts(sPort(802, ""))),
|
||||
|
@ -972,7 +970,7 @@ retryexpression: IsNetworkError() && Attempts() <= 2
|
|||
servers(
|
||||
server("http://10.15.0.1:8080", weight(1)),
|
||||
server("http://10.15.0.2:8080", weight(1))),
|
||||
lbMethod("wrr"), lbSticky(),
|
||||
lbMethod("wrr"), lbStickiness(),
|
||||
),
|
||||
backend("baz",
|
||||
servers(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue