@@ -553,8 +553,11 @@ func getForwardProtocol(service *v1.Service, nodePort int32) (scwlb.Protocol, er
553
553
return scwlb .ProtocolTCP , nil
554
554
}
555
555
556
- func getSSLBridging (service * v1.Service , nodePort int32 ) (bool , error ) {
557
- tlsEnabled := service .Annotations [serviceAnnotationLoadBalancerHTTPBackendTLS ]
556
+ func getSSLBridging (service * v1.Service , nodePort int32 ) (* bool , error ) {
557
+ tlsEnabled , found := service .Annotations [serviceAnnotationLoadBalancerHTTPBackendTLS ]
558
+ if ! found {
559
+ return nil , nil
560
+ }
558
561
559
562
var svcPort int32 = - 1
560
563
for _ , p := range service .Spec .Ports {
@@ -564,20 +567,23 @@ func getSSLBridging(service *v1.Service, nodePort int32) (bool, error) {
564
567
}
565
568
if svcPort == - 1 {
566
569
klog .Errorf ("no valid port found" )
567
- return false , errLoadBalancerInvalidAnnotation
570
+ return nil , errLoadBalancerInvalidAnnotation
568
571
}
569
572
570
573
isTLSEnabled , err := isPortInRange (tlsEnabled , svcPort )
571
574
if err != nil {
572
575
klog .Errorf ("unable to check if port %d is in range %s" , svcPort , tlsEnabled )
573
- return false , err
576
+ return nil , err
574
577
}
575
578
576
- return isTLSEnabled , nil
579
+ return scw . BoolPtr ( isTLSEnabled ) , nil
577
580
}
578
581
579
- func getSSLBridgingSkipVerify (service * v1.Service , nodePort int32 ) (bool , error ) {
580
- skipTLSVerify := service .Annotations [serviceAnnotationLoadBalancerHTTPBackendTLSSkipVerify ]
582
+ func getSSLBridgingSkipVerify (service * v1.Service , nodePort int32 ) (* bool , error ) {
583
+ skipTLSVerify , found := service .Annotations [serviceAnnotationLoadBalancerHTTPBackendTLSSkipVerify ]
584
+ if ! found {
585
+ return nil , nil
586
+ }
581
587
582
588
var svcPort int32 = - 1
583
589
for _ , p := range service .Spec .Ports {
@@ -587,16 +593,16 @@ func getSSLBridgingSkipVerify(service *v1.Service, nodePort int32) (bool, error)
587
593
}
588
594
if svcPort == - 1 {
589
595
klog .Errorf ("no valid port found" )
590
- return false , errLoadBalancerInvalidAnnotation
596
+ return nil , errLoadBalancerInvalidAnnotation
591
597
}
592
598
593
599
isSkipTLSVerify , err := isPortInRange (skipTLSVerify , svcPort )
594
600
if err != nil {
595
601
klog .Errorf ("unable to check if port %d is in range %s" , svcPort , skipTLSVerify )
596
- return false , err
602
+ return nil , err
597
603
}
598
604
599
- return isSkipTLSVerify , nil
605
+ return scw . BoolPtr ( isSkipTLSVerify ) , nil
600
606
}
601
607
602
608
func getCertificateIDs (service * v1.Service , port int32 ) ([]string , error ) {
0 commit comments