File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -1438,7 +1438,7 @@ func (s *Service) getHealthCheckTarget() string {
1438
1438
protocol := & infrav1 .ELBProtocolSSL
1439
1439
if controlPlaneELB != nil && controlPlaneELB .HealthCheckProtocol != nil {
1440
1440
protocol = controlPlaneELB .HealthCheckProtocol
1441
- if protocol == & infrav1 .ELBProtocolHTTP || protocol == & infrav1 .ELBProtocolHTTPS {
1441
+ if protocol . String () == infrav1 .ELBProtocolHTTP . String () || protocol . String () == infrav1 .ELBProtocolHTTPS . String () {
1442
1442
return fmt .Sprintf ("%v:%d/readyz" , protocol , infrav1 .DefaultAPIServerPort )
1443
1443
}
1444
1444
}
Original file line number Diff line number Diff line change @@ -2317,6 +2317,10 @@ func TestChunkELBs(t *testing.T) {
2317
2317
}
2318
2318
2319
2319
func TestGetHealthCheckProtocol (t * testing.T ) {
2320
+ testHTTP := infrav1 .ELBProtocol ("HTTP" )
2321
+ testHTTPS := infrav1 .ELBProtocol ("HTTPS" )
2322
+ testTCP := infrav1 .ELBProtocol ("TCP" )
2323
+
2320
2324
tests := []struct {
2321
2325
testName string
2322
2326
lbSpec * infrav1.AWSLoadBalancerSpec
@@ -2330,21 +2334,21 @@ func TestGetHealthCheckProtocol(t *testing.T) {
2330
2334
{
2331
2335
"protocol http" ,
2332
2336
& infrav1.AWSLoadBalancerSpec {
2333
- HealthCheckProtocol : & infrav1 . ELBProtocolHTTP ,
2337
+ HealthCheckProtocol : & testHTTP ,
2334
2338
},
2335
2339
"HTTP:6443/readyz" ,
2336
2340
},
2337
2341
{
2338
2342
"protocol https" ,
2339
2343
& infrav1.AWSLoadBalancerSpec {
2340
- HealthCheckProtocol : & infrav1 . ELBProtocolHTTPS ,
2344
+ HealthCheckProtocol : & testHTTPS ,
2341
2345
},
2342
2346
"HTTPS:6443/readyz" ,
2343
2347
},
2344
2348
{
2345
2349
"protocol tcp" ,
2346
2350
& infrav1.AWSLoadBalancerSpec {
2347
- HealthCheckProtocol : & infrav1 . ELBProtocolTCP ,
2351
+ HealthCheckProtocol : & testTCP ,
2348
2352
},
2349
2353
"TCP:6443" ,
2350
2354
},
You can’t perform that action at this time.
0 commit comments