@@ -1080,6 +1080,11 @@ func servicePortToBackend(service *v1.Service, loadbalancer *scwlb.LB, port v1.S
10801080 return nil , err
10811081 }
10821082
1083+ timeoutQueue , err := getTimeoutQueue (service )
1084+ if err != nil {
1085+ return nil , err
1086+ }
1087+
10831088 onMarkedDownAction , err := getOnMarkedDownAction (service )
10841089 if err != nil {
10851090 return nil , err
@@ -1090,11 +1095,21 @@ func servicePortToBackend(service *v1.Service, loadbalancer *scwlb.LB, port v1.S
10901095 return nil , err
10911096 }
10921097
1098+ maxConnections , err := getMaxConnections (service )
1099+ if err != nil {
1100+ return nil , err
1101+ }
1102+
10931103 maxRetries , err := getMaxRetries (service )
10941104 if err != nil {
10951105 return nil , err
10961106 }
10971107
1108+ failoverHost , err := getFailoverHost (service )
1109+ if err != nil {
1110+ return nil , err
1111+ }
1112+
10981113 healthCheck := & scwlb.HealthCheck {
10991114 Port : port .NodePort ,
11001115 }
@@ -1195,10 +1210,13 @@ func servicePortToBackend(service *v1.Service, loadbalancer *scwlb.LB, port v1.S
11951210 TimeoutServer : & timeoutServer ,
11961211 TimeoutConnect : & timeoutConnect ,
11971212 TimeoutTunnel : & timeoutTunnel ,
1213+ TimeoutQueue : timeoutQueue ,
11981214 OnMarkedDownAction : onMarkedDownAction ,
11991215 HealthCheck : healthCheck ,
12001216 RedispatchAttemptCount : redispatchAttemptCount ,
1217+ MaxConnections : maxConnections ,
12011218 MaxRetries : maxRetries ,
1219+ FailoverHost : failoverHost ,
12021220 }
12031221
12041222 if stickySessions == scwlb .StickySessionsTypeCookie {
@@ -1316,6 +1334,10 @@ func backendEquals(got, want *scwlb.Backend) bool {
13161334 klog .V (3 ).Infof ("backend.TimeoutTunnel: %s - %s" , got .TimeoutTunnel , want .TimeoutTunnel )
13171335 return false
13181336 }
1337+ if ! durationPtrEqual (got .TimeoutQueue .ToTimeDuration (), want .TimeoutQueue .ToTimeDuration ()) {
1338+ klog .V (3 ).Infof ("backend.TimeoutQueue: %s - %s" , ptrScwDurationToString (got .TimeoutQueue ), ptrScwDurationToString (want .TimeoutQueue ))
1339+ return false
1340+ }
13191341 if got .OnMarkedDownAction != want .OnMarkedDownAction {
13201342 klog .V (3 ).Infof ("backend.OnMarkedDownAction: %s - %s" , got .OnMarkedDownAction , want .OnMarkedDownAction )
13211343 return false
@@ -1324,6 +1346,10 @@ func backendEquals(got, want *scwlb.Backend) bool {
13241346 klog .V (3 ).Infof ("backend.RedispatchAttemptCount: %s - %s" , ptrInt32ToString (got .RedispatchAttemptCount ), ptrInt32ToString (want .RedispatchAttemptCount ))
13251347 return false
13261348 }
1349+ if ! int32PtrEqual (got .MaxConnections , want .MaxConnections ) {
1350+ klog .V (3 ).Infof ("backend.MaxConnections: %s - %s" , ptrInt32ToString (got .MaxConnections ), ptrInt32ToString (want .MaxConnections ))
1351+ return false
1352+ }
13271353 if ! int32PtrEqual (got .MaxRetries , want .MaxRetries ) {
13281354 klog .V (3 ).Infof ("backend.MaxRetries: %s - %s" , ptrInt32ToString (got .MaxRetries ), ptrInt32ToString (want .MaxRetries ))
13291355 return false
@@ -1333,6 +1359,11 @@ func backendEquals(got, want *scwlb.Backend) bool {
13331359 return false
13341360 }
13351361
1362+ if ! ptrStringEqual (got .FailoverHost , want .FailoverHost ) {
1363+ klog .V (3 ).Infof ("backend.FailoverHost: %s - %s" , ptrStringToString (got .FailoverHost ), ptrStringToString (want .FailoverHost ))
1364+ return false
1365+ }
1366+
13361367 if ! reflect .DeepEqual (got .HealthCheck , want .HealthCheck ) {
13371368 klog .V (3 ).Infof ("backend.HealthCheck: %v - %v" , got .HealthCheck , want .HealthCheck )
13381369 return false
@@ -1510,9 +1541,12 @@ func (l *loadbalancers) createBackend(service *v1.Service, loadbalancer *scwlb.L
15101541 TimeoutServer : backend .TimeoutServer ,
15111542 TimeoutConnect : backend .TimeoutConnect ,
15121543 TimeoutTunnel : backend .TimeoutTunnel ,
1544+ TimeoutQueue : backend .TimeoutQueue ,
15131545 OnMarkedDownAction : backend .OnMarkedDownAction ,
15141546 RedispatchAttemptCount : backend .RedispatchAttemptCount ,
1547+ MaxConnections : backend .MaxConnections ,
15151548 MaxRetries : backend .MaxRetries ,
1549+ FailoverHost : backend .FailoverHost ,
15161550 })
15171551 if err != nil {
15181552 return nil , err
@@ -1538,9 +1572,12 @@ func (l *loadbalancers) updateBackend(service *v1.Service, loadbalancer *scwlb.L
15381572 TimeoutServer : backend .TimeoutServer ,
15391573 TimeoutConnect : backend .TimeoutConnect ,
15401574 TimeoutTunnel : backend .TimeoutTunnel ,
1575+ TimeoutQueue : backend .TimeoutQueue ,
15411576 OnMarkedDownAction : backend .OnMarkedDownAction ,
15421577 RedispatchAttemptCount : backend .RedispatchAttemptCount ,
1578+ MaxConnections : backend .MaxConnections ,
15431579 MaxRetries : backend .MaxRetries ,
1580+ FailoverHost : backend .FailoverHost ,
15441581 })
15451582 if err != nil {
15461583 return nil , err
@@ -1608,6 +1645,17 @@ func stringArrayEqual(got, want []string) bool {
16081645 return reflect .DeepEqual (got , want )
16091646}
16101647
1648+ // ptrStringEqual returns true if both strings are equal
1649+ func ptrStringEqual (got , want * string ) bool {
1650+ if got == nil && want == nil {
1651+ return true
1652+ }
1653+ if got == nil || want == nil {
1654+ return false
1655+ }
1656+ return * got == * want
1657+ }
1658+
16111659// stringPtrArrayEqual returns true if both arrays contains the exact same elements regardless of the order
16121660func stringPtrArrayEqual (got , want []* string ) bool {
16131661 slices .SortStableFunc (got , func (a , b * string ) int { return strings .Compare (* a , * b ) })
@@ -1799,3 +1847,17 @@ func nodesInitialized(nodes []*v1.Node) error {
17991847
18001848 return nil
18011849}
1850+
1851+ func ptrStringToString (s * string ) string {
1852+ if s == nil {
1853+ return "<nil>"
1854+ }
1855+ return * s
1856+ }
1857+
1858+ func ptrScwDurationToString (i * scw.Duration ) string {
1859+ if i == nil {
1860+ return "<nil>"
1861+ }
1862+ return i .ToTimeDuration ().String ()
1863+ }
0 commit comments