Skip to content

Commit 59b3d96

Browse files
committed
fix(lb): IgnoreSslServerVerify was not properly set
1 parent 43e1f57 commit 59b3d96

File tree

2 files changed

+15
-11
lines changed

2 files changed

+15
-11
lines changed

scaleway/loadbalancers.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1437,17 +1437,18 @@ func (l *loadbalancers) createBackend(service *v1.Service, loadbalancer *scwlb.L
14371437
Name: backend.Name,
14381438
ForwardProtocol: backend.ForwardProtocol,
14391439
SslBridging: backend.SslBridging,
1440+
IgnoreSslServerVerify: backend.IgnoreSslServerVerify,
14401441
ForwardPort: backend.ForwardPort,
14411442
ForwardPortAlgorithm: backend.ForwardPortAlgorithm,
14421443
StickySessions: backend.StickySessions,
14431444
StickySessionsCookieName: backend.StickySessionsCookieName,
14441445
HealthCheck: backend.HealthCheck,
14451446
ServerIP: backend.Pool,
1447+
ProxyProtocol: backend.ProxyProtocol,
14461448
TimeoutServer: backend.TimeoutServer,
14471449
TimeoutConnect: backend.TimeoutConnect,
14481450
TimeoutTunnel: backend.TimeoutTunnel,
14491451
OnMarkedDownAction: backend.OnMarkedDownAction,
1450-
ProxyProtocol: backend.ProxyProtocol,
14511452
RedispatchAttemptCount: backend.RedispatchAttemptCount,
14521453
MaxRetries: backend.MaxRetries,
14531454
})
@@ -1466,15 +1467,16 @@ func (l *loadbalancers) updateBackend(service *v1.Service, loadbalancer *scwlb.L
14661467
Name: backend.Name,
14671468
ForwardProtocol: backend.ForwardProtocol,
14681469
SslBridging: backend.SslBridging,
1470+
IgnoreSslServerVerify: backend.IgnoreSslServerVerify,
14691471
ForwardPort: backend.ForwardPort,
14701472
ForwardPortAlgorithm: backend.ForwardPortAlgorithm,
14711473
StickySessions: backend.StickySessions,
14721474
StickySessionsCookieName: backend.StickySessionsCookieName,
1475+
ProxyProtocol: backend.ProxyProtocol,
14731476
TimeoutServer: backend.TimeoutServer,
14741477
TimeoutConnect: backend.TimeoutConnect,
14751478
TimeoutTunnel: backend.TimeoutTunnel,
14761479
OnMarkedDownAction: backend.OnMarkedDownAction,
1477-
ProxyProtocol: backend.ProxyProtocol,
14781480
RedispatchAttemptCount: backend.RedispatchAttemptCount,
14791481
MaxRetries: backend.MaxRetries,
14801482
})

scaleway/loadbalancers_test.go

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -732,7 +732,7 @@ func TestFrontendEquals(t *testing.T) {
732732
t.Run(tt.name, func(t *testing.T) {
733733
got := frontendEquals(tt.a, tt.b)
734734
if got != tt.want {
735-
t.Errorf("want: %v, got: %v", got, tt.want)
735+
t.Errorf("want: %v, got: %v", tt.want, got)
736736
}
737737
})
738738
}
@@ -774,6 +774,8 @@ func TestBackendEquals(t *testing.T) {
774774
},
775775
Pool: []string{"1.2.3.4", "2.3.4.5"},
776776
SendProxyV2: &boolTrue,
777+
SslBridging: &boolFalse,
778+
IgnoreSslServerVerify: &boolFalse,
777779
TimeoutServer: &defaultTimeoutServer,
778780
TimeoutConnect: &defaultTimeoutConnect,
779781
TimeoutTunnel: &defaultTimeoutTunnel,
@@ -963,13 +965,13 @@ func TestBackendEquals(t *testing.T) {
963965
a *scwlb.Backend
964966
b *scwlb.Backend
965967
want bool
966-
}{"with same HTTP healthchecks", httpRef, httpDiff, false})
968+
}{"with different HTTP healthchecks", httpRef, httpDiff, false})
967969

968970
for _, tt := range matrix {
969971
t.Run(tt.Name, func(t *testing.T) {
970972
got := backendEquals(tt.a, tt.b)
971973
if got != tt.want {
972-
t.Errorf("want: %v, got: %v", got, tt.want)
974+
t.Errorf("want: %v, got: %v", tt.want, got)
973975
}
974976
})
975977
}
@@ -996,7 +998,7 @@ func TestStringArrayEqual(t *testing.T) {
996998
t.Run(tt.name, func(t *testing.T) {
997999
got := stringArrayEqual(tt.a, tt.b)
9981000
if got != tt.want {
999-
t.Errorf("want: %v, got: %v", got, tt.want)
1001+
t.Errorf("want: %v, got: %v", tt.want, got)
10001002
}
10011003
})
10021004
}
@@ -1022,7 +1024,7 @@ func TestStringPtrArrayEqual(t *testing.T) {
10221024
t.Run(tt.name, func(t *testing.T) {
10231025
got := stringPtrArrayEqual(tt.a, tt.b)
10241026
if got != tt.want {
1025-
t.Errorf("want: %v, got: %v", got, tt.want)
1027+
t.Errorf("want: %v, got: %v", tt.want, got)
10261028
}
10271029
})
10281030
}
@@ -1050,7 +1052,7 @@ func TestDurationPtrEqual(t *testing.T) {
10501052
t.Run(tt.name, func(t *testing.T) {
10511053
got := durationPtrEqual(tt.a, tt.b)
10521054
if got != tt.want {
1053-
t.Errorf("want: %v, got: %v", got, tt.want)
1055+
t.Errorf("want: %v, got: %v", tt.want, got)
10541056
}
10551057
})
10561058
}
@@ -1078,7 +1080,7 @@ func TestScwDurationPtrEqual(t *testing.T) {
10781080
t.Run(tt.name, func(t *testing.T) {
10791081
got := scwDurationPtrEqual(tt.a, tt.b)
10801082
if got != tt.want {
1081-
t.Errorf("want: %v, got: %v", got, tt.want)
1083+
t.Errorf("want: %v, got: %v", tt.want, got)
10821084
}
10831085
})
10841086
}
@@ -1135,7 +1137,7 @@ func TestChunkArray(t *testing.T) {
11351137
t.Run(tt.name, func(t *testing.T) {
11361138
got := chunkArray(tt.array, 3)
11371139
if !reflect.DeepEqual(got, tt.want) {
1138-
t.Errorf("want: %v, got: %v", got, tt.want)
1140+
t.Errorf("want: %v, got: %v", tt.want, got)
11391141
}
11401142
})
11411143
}
@@ -1155,7 +1157,7 @@ func TestMakeACLPrefix(t *testing.T) {
11551157
t.Run(tt.name, func(t *testing.T) {
11561158
got := makeACLPrefix(tt.frontend)
11571159
if got != tt.want {
1158-
t.Errorf("want: %v, got: %v", got, tt.want)
1160+
t.Errorf("want: %v, got: %v", tt.want, got)
11591161
}
11601162
})
11611163
}

0 commit comments

Comments
 (0)