Skip to content

Commit

Permalink
[Fix] Operator: Sticky cookie corrected
Browse files Browse the repository at this point in the history
In some cases using the same JSESSIONID cookie as the one that approuter uses does not seem to work!
Try to fix this by setting a different cookie.

Change-Id: I66b68a10ad66a9d3c3dbfd578096baf6d137b0e6
  • Loading branch information
Pavan-SAP committed Jan 10, 2024
1 parent 3fd5550 commit a6415af
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion internal/controller/reconcile-domains.go
Original file line number Diff line number Diff line change
Expand Up @@ -680,7 +680,7 @@ func (c *Controller) getUpdatedTenantDestinationRuleObject(ctx context.Context,
ConsistentHash: &networkingv1beta1.LoadBalancerSettings_ConsistentHashLB{
HashKey: &networkingv1beta1.LoadBalancerSettings_ConsistentHashLB_HttpCookie{
HttpCookie: &networkingv1beta1.LoadBalancerSettings_ConsistentHashLB_HTTPCookie{
Name: HttpCookieName,
Name: RouterHttpCookieName,
Ttl: durationpb.New(0 * time.Second),
Path: "/",
},
Expand Down
4 changes: 2 additions & 2 deletions internal/controller/reconcile.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ const (
ConsumerTenantType = "consumer"
)

// Use same name as default cookie from approuter used for session stickiness
const HttpCookieName = "JSESSIONID"
// Use a different name for sticky cookie than the one from approuter (JSESSIONID) used for session handling
const RouterHttpCookieName = "CAPOP_ROUTER_STICKY"

const (
EnvCAPOpAppVersion = "CAPOP_APP_VERSION"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,6 @@ spec:
loadBalancer:
consistentHash:
httpCookie:
name: JSESSIONID
name: CAPOP_ROUTER_STICKY
path: /
ttl: 0s
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,6 @@ spec:
loadBalancer:
consistentHash:
httpCookie:
name: JSESSIONID
name: CAPOP_ROUTER_STICKY
path: /
ttl: 0s
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,6 @@ spec:
loadBalancer:
consistentHash:
httpCookie:
name: JSESSIONID
name: CAPOP_ROUTER_STICKY
path: /
ttl: 0s
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ spec:
loadBalancer:
consistentHash:
httpCookie:
name: JSESSIONID
name: CAPOP_ROUTER_STICKY
path: /
ttl: 0s
---
Expand Down
2 changes: 1 addition & 1 deletion internal/controller/testdata/captenant/cat-17.initial.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,6 @@ spec:
loadBalancer:
consistentHash:
httpCookie:
name: JSESSIONID
name: CAPOP_ROUTER_STICKY
path: /
ttl: 0s
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ spec:
loadBalancer:
consistentHash:
httpCookie:
name: JSESSIONID
name: CAPOP_ROUTER_STICKY
path: /
ttl: 0s

0 comments on commit a6415af

Please sign in to comment.