Skip to content

Commit 111a870

Browse files
committed
feat(loadbalancer): add spec.healthCheckNodePort tests
Signed-off-by: Damien DASSIEU <ddassieu@scaleway.com>
1 parent 25de738 commit 111a870

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

scaleway/loadbalancers_test.go

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -434,6 +434,45 @@ func TestGetHealthCheckPort(t *testing.T) {
434434
result: 0,
435435
errMessage: "load balancer invalid annotation",
436436
},
437+
{
438+
name: "standalone healthCheckNodePort has no effect",
439+
svc: &v1.Service{
440+
Spec: v1.ServiceSpec{
441+
HealthCheckNodePort: 65535,
442+
Ports: []v1.ServicePort{
443+
{
444+
NodePort: 30080,
445+
Port: 80,
446+
},
447+
},
448+
},
449+
},
450+
nodePort: 30080,
451+
result: 30080,
452+
errMessage: "",
453+
},
454+
{
455+
name: "healthCheckNodePort with annotation has no effect",
456+
svc: &v1.Service{
457+
ObjectMeta: metav1.ObjectMeta{
458+
Annotations: map[string]string{
459+
"service.beta.kubernetes.io/scw-loadbalancer-health-check-port": "28390",
460+
},
461+
},
462+
Spec: v1.ServiceSpec{
463+
HealthCheckNodePort: 65535,
464+
Ports: []v1.ServicePort{
465+
{
466+
NodePort: 30080,
467+
Port: 80,
468+
},
469+
},
470+
},
471+
},
472+
nodePort: 30080,
473+
result: 28390,
474+
errMessage: "",
475+
},
437476
}
438477

439478
for _, tc := range testCases {

0 commit comments

Comments
 (0)