Skip to content

Commit 51c5998

Browse files
committed
chore: multiple pl test
1 parent 66afd13 commit 51c5998

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

pkg/service/model_build_managed_sg_test.go

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,53 @@ func Test_buildCIDRsFromSourceRanges_buildManagedSecurityGroupIngressPermissions
223223
},
224224
},
225225
},
226+
{
227+
name: "no ip range but multiple prefix lists",
228+
fields: fields{
229+
svc: &corev1.Service{
230+
ObjectMeta: metav1.ObjectMeta{
231+
Annotations: map[string]string{
232+
"service.beta.kubernetes.io/aws-load-balancer-security-group-prefix-lists": "pl-xxxxx, pl-yyyyyy",
233+
},
234+
},
235+
Spec: corev1.ServiceSpec{
236+
Type: corev1.ServiceTypeNodePort,
237+
Ports: []corev1.ServicePort{
238+
{
239+
Name: "http",
240+
Port: 80,
241+
NodePort: 18080,
242+
},
243+
},
244+
LoadBalancerSourceRanges: []string{},
245+
},
246+
},
247+
ipAddressType: elbv2model.IPAddressTypeDualStack,
248+
},
249+
wantErr: false,
250+
want: []ec2model.IPPermission{
251+
{
252+
IPProtocol: "",
253+
FromPort: aws.Int64(80),
254+
ToPort: aws.Int64(80),
255+
PrefixLists: []ec2model.PrefixList{
256+
{
257+
ListID: "pl-xxxxx",
258+
},
259+
},
260+
},
261+
{
262+
IPProtocol: "",
263+
FromPort: aws.Int64(80),
264+
ToPort: aws.Int64(80),
265+
PrefixLists: []ec2model.PrefixList{
266+
{
267+
ListID: "pl-yyyyyy",
268+
},
269+
},
270+
},
271+
},
272+
},
226273
}
227274
for _, tt := range tests {
228275
t.Run(tt.name, func(t1 *testing.T) {

0 commit comments

Comments
 (0)