Skip to content

Commit

Permalink
load_balancing: support header session affinity policy
Browse files Browse the repository at this point in the history
  • Loading branch information
Cole Bennett committed Jul 5, 2023
1 parent bddcc22 commit 46798ef
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
3 changes: 3 additions & 0 deletions .changelog/1302.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
load_balancing: support header session affinity policy
```
18 changes: 11 additions & 7 deletions load_balancing.go
Original file line number Diff line number Diff line change
Expand Up @@ -253,17 +253,21 @@ type LocationStrategy struct {
// LoadBalancerRuleOverridesSessionAffinityAttrs mimics SessionAffinityAttributes without the
// DrainDuration field as that field can not be overwritten via rules.
type LoadBalancerRuleOverridesSessionAffinityAttrs struct {
SameSite string `json:"samesite,omitempty"`
Secure string `json:"secure,omitempty"`
ZeroDowntimeFailover string `json:"zero_downtime_failover,omitempty"`
SameSite string `json:"samesite,omitempty"`
Secure string `json:"secure,omitempty"`
ZeroDowntimeFailover string `json:"zero_downtime_failover,omitempty"`
Headers []string `json:"headers,omitempty"`
RequireAllHeaders *bool `json:"require_all_headers,omitempty"`
}

// SessionAffinityAttributes represents the fields used to set attributes in a load balancer session affinity cookie.
type SessionAffinityAttributes struct {
SameSite string `json:"samesite,omitempty"`
Secure string `json:"secure,omitempty"`
DrainDuration int `json:"drain_duration,omitempty"`
ZeroDowntimeFailover string `json:"zero_downtime_failover,omitempty"`
SameSite string `json:"samesite,omitempty"`
Secure string `json:"secure,omitempty"`
DrainDuration int `json:"drain_duration,omitempty"`
ZeroDowntimeFailover string `json:"zero_downtime_failover,omitempty"`
Headers []string `json:"headers,omitempty"`
RequireAllHeaders bool `json:"require_all_headers,omitempty"`
}

// LoadBalancerOriginHealth represents the health of the origin.
Expand Down

0 comments on commit 46798ef

Please sign in to comment.