File tree Expand file tree Collapse file tree 1 file changed +47
-0
lines changed Expand file tree Collapse file tree 1 file changed +47
-0
lines changed Original file line number Diff line number Diff line change @@ -223,6 +223,53 @@ func Test_buildCIDRsFromSourceRanges_buildManagedSecurityGroupIngressPermissions
223
223
},
224
224
},
225
225
},
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
+ },
226
273
}
227
274
for _ , tt := range tests {
228
275
t .Run (tt .name , func (t1 * testing.T ) {
You can’t perform that action at this time.
0 commit comments