Skip to content

Commit 9fa98d5

Browse files
committed
fix(lb): sslBridging default to false and not nil
1 parent 1eb0f34 commit 9fa98d5

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

docs/loadbalancer-annotations.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ NB: forwarding HTTPS traffic with HTTP protocol enabled will work only if using
162162

163163
### `service.beta.kubernetes.io/scw-loadbalancer-http-backend-tls`
164164
This is the annotation to enable tls towards the backend when using http forward protocol
165-
The possible values are `false`, `true` or `*` for all ports or a comma delimited list of the service port (for instance `80,443`)
165+
Default to `false`. The possible values are `false`, `true` or `*` for all ports or a comma delimited list of the service port (for instance `80,443`)
166166

167167
### `service.beta.kubernetes.io/scw-loadbalancer-http-backend-tls-skip-verify`
168168
This is the annotation to skip tls verification on backends when using http forward protocol with TLS enabled

scaleway/loadbalancers.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1221,7 +1221,7 @@ func servicePortToBackend(service *v1.Service, loadbalancer *scwlb.LB, port v1.S
12211221
Name: fmt.Sprintf("%s_tcp_%d", string(service.UID), port.NodePort),
12221222
Pool: nodeIPs,
12231223
ForwardProtocol: protocol,
1224-
SslBridging: sslBridging,
1224+
SslBridging: &sslBridging,
12251225
IgnoreSslServerVerify: sslSkipVerify,
12261226
ForwardPort: port.NodePort,
12271227
ForwardPortAlgorithm: forwardPortAlgorithm,

scaleway/loadbalancers_annotations.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,8 @@ const (
157157
// (for instance "80,443")
158158
serviceAnnotationLoadBalancerProtocolHTTP = "service.beta.kubernetes.io/scw-loadbalancer-protocol-http"
159159

160-
// serviceAnnotationLoadBalancerHTTPBackendTLS is the annotation to enable tls towards the backend when using http forward protocol
161-
// The possible values are "false", "true" or "*" for all ports or a comma delimited list of the service port
160+
// serviceAnnotationLoadBalancerHTTPBackendTLS is the annotation to enable tls towards the backend when using http forward protocol.
161+
// Default to "false". The possible values are "false", "true" or "*" for all ports or a comma delimited list of the service port
162162
// (for instance "80,443")
163163
serviceAnnotationLoadBalancerHTTPBackendTLS = "service.beta.kubernetes.io/scw-loadbalancer-http-backend-tls"
164164

@@ -659,10 +659,10 @@ func getForwardProtocol(service *v1.Service, nodePort int32) (scwlb.Protocol, er
659659
return scwlb.ProtocolTCP, nil
660660
}
661661

662-
func getSSLBridging(service *v1.Service, nodePort int32) (*bool, error) {
662+
func getSSLBridging(service *v1.Service, nodePort int32) (bool, error) {
663663
tlsEnabled, found := service.Annotations[serviceAnnotationLoadBalancerHTTPBackendTLS]
664664
if !found {
665-
return nil, nil
665+
return false, nil
666666
}
667667

668668
var svcPort int32 = -1
@@ -673,16 +673,16 @@ func getSSLBridging(service *v1.Service, nodePort int32) (*bool, error) {
673673
}
674674
if svcPort == -1 {
675675
klog.Errorf("no valid port found")
676-
return nil, errLoadBalancerInvalidAnnotation
676+
return false, errLoadBalancerInvalidAnnotation
677677
}
678678

679679
isTLSEnabled, err := isPortInRange(tlsEnabled, svcPort)
680680
if err != nil {
681681
klog.Errorf("unable to check if port %d is in range %s", svcPort, tlsEnabled)
682-
return nil, err
682+
return false, err
683683
}
684684

685-
return scw.BoolPtr(isTLSEnabled), nil
685+
return isTLSEnabled, nil
686686
}
687687

688688
func getSSLBridgingSkipVerify(service *v1.Service, nodePort int32) (*bool, error) {

0 commit comments

Comments
 (0)