Skip to content

Commit 0f5d67c

Browse files
committed
chore(unit): Replace magic numbers with existing constants
Signed-off-by: Borja Clemente <borja.clemente@gmail.com>
1 parent 58f038b commit 0f5d67c

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

controllers/awscluster_controller_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1485,10 +1485,10 @@ func mockedCallsForMissingEverything(m *mocks.MockEC2APIMockRecorder, e *mocks.M
14851485
LoadBalancerName: aws.String("test-cluster-apiserver"),
14861486
HealthCheck: &elbtypes.HealthCheck{
14871487
Target: aws.String("TCP:6443"),
1488-
Interval: aws.Int32(5),
1489-
Timeout: aws.Int32(4),
1490-
HealthyThreshold: aws.Int32(2),
1491-
UnhealthyThreshold: aws.Int32(6),
1488+
Interval: aws.Int32(infrav1.DefaultAPIServerHealthCheckIntervalSec),
1489+
Timeout: aws.Int32(infrav1.DefaultAPIServerHealthCheckTimeoutSec),
1490+
HealthyThreshold: aws.Int32(infrav1.DefaultAPIServerHealthThresholdCount),
1491+
UnhealthyThreshold: aws.Int32(infrav1.DefaultAPIServerUnhealthThresholdCount),
14921492
},
14931493
})).Return(&elb.ConfigureHealthCheckOutput{}, nil)
14941494
}

pkg/cloud/services/elb/loadbalancer_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,10 @@ var stubInfraV1TargetGroupSpecAPI = infrav1.TargetGroupSpec{
5656
Port: infrav1.DefaultAPIServerPort,
5757
Protocol: "TCP",
5858
HealthCheck: &infrav1.TargetGroupHealthCheck{
59-
IntervalSeconds: aws.Int64(5),
60-
TimeoutSeconds: aws.Int64(4),
61-
ThresholdCount: aws.Int64(2),
62-
UnhealthyThresholdCount: aws.Int64(6),
59+
IntervalSeconds: aws.Int64(infrav1.DefaultAPIServerHealthCheckIntervalSec),
60+
TimeoutSeconds: aws.Int64(infrav1.DefaultAPIServerHealthCheckTimeoutSec),
61+
ThresholdCount: aws.Int64(infrav1.DefaultAPIServerHealthThresholdCount),
62+
UnhealthyThresholdCount: aws.Int64(infrav1.DefaultAPIServerUnhealthThresholdCount),
6363
},
6464
}
6565

0 commit comments

Comments
 (0)