Support domain configuration for sticky cookies
This commit is contained in:
parent
fa76ed57d3
commit
740b4cfd25
24 changed files with 184 additions and 0 deletions
|
@ -260,6 +260,7 @@ func (c configBuilder) buildServicesLB(ctx context.Context, namespace string, tS
|
|||
HTTPOnly: tService.Weighted.Sticky.Cookie.HTTPOnly,
|
||||
SameSite: tService.Weighted.Sticky.Cookie.SameSite,
|
||||
MaxAge: tService.Weighted.Sticky.Cookie.MaxAge,
|
||||
Domain: tService.Weighted.Sticky.Cookie.Domain,
|
||||
},
|
||||
}
|
||||
sticky.Cookie.SetDefaults()
|
||||
|
@ -382,6 +383,7 @@ func (c configBuilder) buildServersLB(namespace string, svc traefikv1alpha1.Load
|
|||
HTTPOnly: svc.Sticky.Cookie.HTTPOnly,
|
||||
SameSite: svc.Sticky.Cookie.SameSite,
|
||||
MaxAge: svc.Sticky.Cookie.MaxAge,
|
||||
Domain: svc.Sticky.Cookie.Domain,
|
||||
},
|
||||
}
|
||||
lb.Sticky.Cookie.SetDefaults()
|
||||
|
|
|
@ -121,6 +121,7 @@ func Test_parseServiceConfig(t *testing.T) {
|
|||
"traefik.ingress.kubernetes.io/service.sticky.cookie.name": "foobar",
|
||||
"traefik.ingress.kubernetes.io/service.sticky.cookie.secure": "true",
|
||||
"traefik.ingress.kubernetes.io/service.sticky.cookie.samesite": "none",
|
||||
"traefik.ingress.kubernetes.io/service.sticky.cookie.domain": "foo.com",
|
||||
"traefik.ingress.kubernetes.io/service.sticky.cookie.path": "foobar",
|
||||
},
|
||||
expected: &ServiceConfig{
|
||||
|
@ -131,6 +132,7 @@ func Test_parseServiceConfig(t *testing.T) {
|
|||
Secure: true,
|
||||
HTTPOnly: true,
|
||||
SameSite: "none",
|
||||
Domain: "foo.com",
|
||||
Path: pointer("foobar"),
|
||||
},
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue