Skip to content

Commit 5a6a8ae

Browse files
author
speruri
committed
add tests
1 parent e956f6c commit 5a6a8ae

File tree

1 file changed

+68
-0
lines changed

1 file changed

+68
-0
lines changed

kubernetes/adapter_test.go

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,74 @@ func TestNewIngressFromKube(tt *testing.T) {
259259
},
260260
},
261261
},
262+
{
263+
msg: "test NLB with dualstack ip annotation",
264+
defaultLoadBalancerType: aws.LoadBalancerTypeNetwork,
265+
ingress: &Ingress{
266+
ResourceType: TypeIngress,
267+
Namespace: "default",
268+
Name: "foo",
269+
Hostname: "bar",
270+
Scheme: "internet-facing",
271+
Shared: true,
272+
HTTP2: true,
273+
ClusterLocal: true,
274+
SSLPolicy: testSSLPolicy,
275+
IPAddressType: aws.IPAddressTypeDualstack,
276+
LoadBalancerType: aws.LoadBalancerTypeNetwork,
277+
SecurityGroup: testIngressDefaultSecurityGroup,
278+
},
279+
kubeIngress: &ingress{
280+
Metadata: kubeItemMetadata{
281+
Namespace: "default",
282+
Name: "foo",
283+
Annotations: map[string]string{
284+
ingressIPAddressType: aws.IPAddressTypeDualstack,
285+
},
286+
},
287+
Status: ingressStatus{
288+
LoadBalancer: ingressLoadBalancerStatus{
289+
Ingress: []ingressLoadBalancer{
290+
{Hostname: "bar"},
291+
},
292+
},
293+
},
294+
},
295+
},
296+
{
297+
msg: "test ALB with dualstack ip annotation",
298+
defaultLoadBalancerType: aws.LoadBalancerTypeApplication,
299+
ingress: &Ingress{
300+
ResourceType: TypeIngress,
301+
Namespace: "default",
302+
Name: "foo",
303+
Hostname: "bar",
304+
Scheme: "internet-facing",
305+
Shared: true,
306+
HTTP2: true,
307+
ClusterLocal: true,
308+
SSLPolicy: testSSLPolicy,
309+
IPAddressType: aws.IPAddressTypeDualstack,
310+
LoadBalancerType: aws.LoadBalancerTypeApplication,
311+
SecurityGroup: testIngressDefaultSecurityGroup,
312+
},
313+
kubeIngress: &ingress{
314+
Metadata: kubeItemMetadata{
315+
Namespace: "default",
316+
Name: "foo",
317+
Annotations: map[string]string{
318+
ingressIPAddressType: aws.IPAddressTypeDualstack,
319+
},
320+
},
321+
Status: ingressStatus{
322+
LoadBalancer: ingressLoadBalancerStatus{
323+
Ingress: []ingressLoadBalancer{
324+
{Hostname: "bar"},
325+
},
326+
},
327+
},
328+
},
329+
},
262330
{
263331
msg: "test default NLB with security group fallbacks to ALB",
264332
defaultLoadBalancerType: aws.LoadBalancerTypeNetwork,

0 commit comments

Comments
 (0)