@@ -1018,6 +1018,11 @@ func servicePortToBackend(service *v1.Service, loadbalancer *scwlb.LB, port v1.S
10181018 return nil , err
10191019 }
10201020
1021+ timeoutQueue , err := getTimeoutQueue (service )
1022+ if err != nil {
1023+ return nil , err
1024+ }
1025+
10211026 onMarkedDownAction , err := getOnMarkedDownAction (service )
10221027 if err != nil {
10231028 return nil , err
@@ -1028,11 +1033,21 @@ func servicePortToBackend(service *v1.Service, loadbalancer *scwlb.LB, port v1.S
10281033 return nil , err
10291034 }
10301035
1036+ maxConnections , err := getMaxConnections (service )
1037+ if err != nil {
1038+ return nil , err
1039+ }
1040+
10311041 maxRetries , err := getMaxRetries (service )
10321042 if err != nil {
10331043 return nil , err
10341044 }
10351045
1046+ failoverHost , err := getFailoverHost (service )
1047+ if err != nil {
1048+ return nil , err
1049+ }
1050+
10361051 healthCheck := & scwlb.HealthCheck {
10371052 Port : port .NodePort ,
10381053 }
@@ -1133,10 +1148,13 @@ func servicePortToBackend(service *v1.Service, loadbalancer *scwlb.LB, port v1.S
11331148 TimeoutServer : & timeoutServer ,
11341149 TimeoutConnect : & timeoutConnect ,
11351150 TimeoutTunnel : & timeoutTunnel ,
1151+ TimeoutQueue : timeoutQueue ,
11361152 OnMarkedDownAction : onMarkedDownAction ,
11371153 HealthCheck : healthCheck ,
11381154 RedispatchAttemptCount : redispatchAttemptCount ,
1155+ MaxConnections : maxConnections ,
11391156 MaxRetries : maxRetries ,
1157+ FailoverHost : failoverHost ,
11401158 }
11411159
11421160 if stickySessions == scwlb .StickySessionsTypeCookie {
@@ -1254,6 +1272,10 @@ func backendEquals(got, want *scwlb.Backend) bool {
12541272 klog .V (3 ).Infof ("backend.TimeoutTunnel: %s - %s" , got .TimeoutTunnel , want .TimeoutTunnel )
12551273 return false
12561274 }
1275+ if ! durationPtrEqual (got .TimeoutQueue .ToTimeDuration (), want .TimeoutQueue .ToTimeDuration ()) {
1276+ klog .V (3 ).Infof ("backend.TimeoutQueue: %s - %s" , ptrScwDurationToString (got .TimeoutQueue ), ptrScwDurationToString (want .TimeoutQueue ))
1277+ return false
1278+ }
12571279 if got .OnMarkedDownAction != want .OnMarkedDownAction {
12581280 klog .V (3 ).Infof ("backend.OnMarkedDownAction: %s - %s" , got .OnMarkedDownAction , want .OnMarkedDownAction )
12591281 return false
@@ -1262,6 +1284,10 @@ func backendEquals(got, want *scwlb.Backend) bool {
12621284 klog .V (3 ).Infof ("backend.RedispatchAttemptCount: %s - %s" , ptrInt32ToString (got .RedispatchAttemptCount ), ptrInt32ToString (want .RedispatchAttemptCount ))
12631285 return false
12641286 }
1287+ if ! int32PtrEqual (got .MaxConnections , want .MaxConnections ) {
1288+ klog .V (3 ).Infof ("backend.MaxConnections: %s - %s" , ptrInt32ToString (got .MaxConnections ), ptrInt32ToString (want .MaxConnections ))
1289+ return false
1290+ }
12651291 if ! int32PtrEqual (got .MaxRetries , want .MaxRetries ) {
12661292 klog .V (3 ).Infof ("backend.MaxRetries: %s - %s" , ptrInt32ToString (got .MaxRetries ), ptrInt32ToString (want .MaxRetries ))
12671293 return false
@@ -1271,6 +1297,11 @@ func backendEquals(got, want *scwlb.Backend) bool {
12711297 return false
12721298 }
12731299
1300+ if ! ptrStringEqual (got .FailoverHost , want .FailoverHost ) {
1301+ klog .V (3 ).Infof ("backend.FailoverHost: %s - %s" , ptrStringToString (got .FailoverHost ), ptrStringToString (want .FailoverHost ))
1302+ return false
1303+ }
1304+
12741305 if ! reflect .DeepEqual (got .HealthCheck , want .HealthCheck ) {
12751306 klog .V (3 ).Infof ("backend.HealthCheck: %v - %v" , got .HealthCheck , want .HealthCheck )
12761307 return false
@@ -1448,9 +1479,12 @@ func (l *loadbalancers) createBackend(service *v1.Service, loadbalancer *scwlb.L
14481479 TimeoutServer : backend .TimeoutServer ,
14491480 TimeoutConnect : backend .TimeoutConnect ,
14501481 TimeoutTunnel : backend .TimeoutTunnel ,
1482+ TimeoutQueue : backend .TimeoutQueue ,
14511483 OnMarkedDownAction : backend .OnMarkedDownAction ,
14521484 RedispatchAttemptCount : backend .RedispatchAttemptCount ,
1485+ MaxConnections : backend .MaxConnections ,
14531486 MaxRetries : backend .MaxRetries ,
1487+ FailoverHost : backend .FailoverHost ,
14541488 })
14551489 if err != nil {
14561490 return nil , err
@@ -1476,9 +1510,12 @@ func (l *loadbalancers) updateBackend(service *v1.Service, loadbalancer *scwlb.L
14761510 TimeoutServer : backend .TimeoutServer ,
14771511 TimeoutConnect : backend .TimeoutConnect ,
14781512 TimeoutTunnel : backend .TimeoutTunnel ,
1513+ TimeoutQueue : backend .TimeoutQueue ,
14791514 OnMarkedDownAction : backend .OnMarkedDownAction ,
14801515 RedispatchAttemptCount : backend .RedispatchAttemptCount ,
1516+ MaxConnections : backend .MaxConnections ,
14811517 MaxRetries : backend .MaxRetries ,
1518+ FailoverHost : backend .FailoverHost ,
14821519 })
14831520 if err != nil {
14841521 return nil , err
@@ -1546,6 +1583,17 @@ func stringArrayEqual(got, want []string) bool {
15461583 return reflect .DeepEqual (got , want )
15471584}
15481585
1586+ // ptrStringEqual returns true if both strings are equal
1587+ func ptrStringEqual (got , want * string ) bool {
1588+ if got == nil && want == nil {
1589+ return true
1590+ }
1591+ if got == nil || want == nil {
1592+ return false
1593+ }
1594+ return * got == * want
1595+ }
1596+
15491597// stringPtrArrayEqual returns true if both arrays contains the exact same elements regardless of the order
15501598func stringPtrArrayEqual (got , want []* string ) bool {
15511599 slices .SortStableFunc (got , func (a , b * string ) int { return strings .Compare (* a , * b ) })
@@ -1675,3 +1723,17 @@ func ptrBoolToString(b *bool) string {
16751723 }
16761724 return fmt .Sprintf ("%t" , * b )
16771725}
1726+
1727+ func ptrStringToString (s * string ) string {
1728+ if s == nil {
1729+ return "<nil>"
1730+ }
1731+ return * s
1732+ }
1733+
1734+ func ptrScwDurationToString (i * scw.Duration ) string {
1735+ if i == nil {
1736+ return "<nil>"
1737+ }
1738+ return fmt .Sprintf ("%s" , i .ToTimeDuration ().String ())
1739+ }
0 commit comments