@@ -553,8 +553,11 @@ func getForwardProtocol(service *v1.Service, nodePort int32) (scwlb.Protocol, er
553553 return scwlb .ProtocolTCP , nil
554554}
555555
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+ }
558561
559562 var svcPort int32 = - 1
560563 for _ , p := range service .Spec .Ports {
@@ -564,20 +567,23 @@ func getSSLBridging(service *v1.Service, nodePort int32) (bool, error) {
564567 }
565568 if svcPort == - 1 {
566569 klog .Errorf ("no valid port found" )
567- return false , errLoadBalancerInvalidAnnotation
570+ return nil , errLoadBalancerInvalidAnnotation
568571 }
569572
570573 isTLSEnabled , err := isPortInRange (tlsEnabled , svcPort )
571574 if err != nil {
572575 klog .Errorf ("unable to check if port %d is in range %s" , svcPort , tlsEnabled )
573- return false , err
576+ return nil , err
574577 }
575578
576- return isTLSEnabled , nil
579+ return scw . BoolPtr ( isTLSEnabled ) , nil
577580}
578581
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+ }
581587
582588 var svcPort int32 = - 1
583589 for _ , p := range service .Spec .Ports {
@@ -587,16 +593,16 @@ func getSSLBridgingSkipVerify(service *v1.Service, nodePort int32) (bool, error)
587593 }
588594 if svcPort == - 1 {
589595 klog .Errorf ("no valid port found" )
590- return false , errLoadBalancerInvalidAnnotation
596+ return nil , errLoadBalancerInvalidAnnotation
591597 }
592598
593599 isSkipTLSVerify , err := isPortInRange (skipTLSVerify , svcPort )
594600 if err != nil {
595601 klog .Errorf ("unable to check if port %d is in range %s" , svcPort , skipTLSVerify )
596- return false , err
602+ return nil , err
597603 }
598604
599- return isSkipTLSVerify , nil
605+ return scw . BoolPtr ( isSkipTLSVerify ) , nil
600606}
601607
602608func getCertificateIDs (service * v1.Service , port int32 ) ([]string , error ) {
0 commit comments