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 18, 2023
1 parent bddcc22 commit 81b8b68
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 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
```
20 changes: 12 additions & 8 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.
// SessionAffinityAttributes represents additional configuration options for session affinity.
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 81b8b68

Please sign in to comment.