@@ -26,6 +26,7 @@ import (
26
26
27
27
func TestGetLoadBalancerSourceRanges (t * testing.T ) {
28
28
checkError := func (v string ) {
29
+ t .Helper ()
29
30
annotations := make (map [string ]string )
30
31
annotations [v1 .AnnotationLoadBalancerSourceRangesKey ] = v
31
32
svc := v1.Service {}
@@ -49,6 +50,7 @@ func TestGetLoadBalancerSourceRanges(t *testing.T) {
49
50
checkError ("10.0.0.1" )
50
51
51
52
checkOK := func (v string ) utilnet.IPNetSet {
53
+ t .Helper ()
52
54
annotations := make (map [string ]string )
53
55
annotations [v1 .AnnotationLoadBalancerSourceRangesKey ] = v
54
56
svc := v1.Service {}
@@ -112,6 +114,7 @@ func TestGetLoadBalancerSourceRanges(t *testing.T) {
112
114
113
115
func TestAllowAll (t * testing.T ) {
114
116
checkAllowAll := func (allowAll bool , cidrs ... string ) {
117
+ t .Helper ()
115
118
ipnets , err := utilnet .ParseIPNets (cidrs ... )
116
119
if err != nil {
117
120
t .Errorf ("Unexpected error parsing cidrs: %v" , cidrs )
@@ -131,6 +134,7 @@ func TestAllowAll(t *testing.T) {
131
134
132
135
func TestExternallyAccessible (t * testing.T ) {
133
136
checkExternallyAccessible := func (expect bool , service * v1.Service ) {
137
+ t .Helper ()
134
138
res := ExternallyAccessible (service )
135
139
if res != expect {
136
140
t .Errorf ("Expected ExternallyAccessible = %v, got %v" , expect , res )
@@ -174,6 +178,7 @@ func TestExternallyAccessible(t *testing.T) {
174
178
175
179
func TestExternalPolicyLocal (t * testing.T ) {
176
180
checkExternalPolicyLocal := func (requestsOnlyLocalTraffic bool , service * v1.Service ) {
181
+ t .Helper ()
177
182
res := ExternalPolicyLocal (service )
178
183
if res != requestsOnlyLocalTraffic {
179
184
t .Errorf ("Expected requests OnlyLocal traffic = %v, got %v" ,
@@ -240,6 +245,7 @@ func TestExternalPolicyLocal(t *testing.T) {
240
245
241
246
func TestNeedsHealthCheck (t * testing.T ) {
242
247
checkNeedsHealthCheck := func (needsHealthCheck bool , service * v1.Service ) {
248
+ t .Helper ()
243
249
res := NeedsHealthCheck (service )
244
250
if res != needsHealthCheck {
245
251
t .Errorf ("Expected needs health check = %v, got %v" ,
@@ -280,6 +286,7 @@ func TestNeedsHealthCheck(t *testing.T) {
280
286
281
287
func TestInternalPolicyLocal (t * testing.T ) {
282
288
checkInternalPolicyLocal := func (expected bool , service * v1.Service ) {
289
+ t .Helper ()
283
290
res := InternalPolicyLocal (service )
284
291
if res != expected {
285
292
t .Errorf ("Expected internal local traffic = %v, got %v" ,
0 commit comments