@@ -203,7 +203,7 @@ func Test_defaultSubnetsResolver_ResolveViaDiscovery(t *testing.T) {
203
203
},
204
204
},
205
205
{
206
- name : "ALB with no matching subnets" ,
206
+ name : "ALB with no matching subnets (internal) " ,
207
207
fields : fields {
208
208
vpcID : "vpc-1" ,
209
209
clusterName : "kube-cluster" ,
@@ -231,7 +231,38 @@ func Test_defaultSubnetsResolver_ResolveViaDiscovery(t *testing.T) {
231
231
WithSubnetsResolveLBScheme (elbv2model .LoadBalancerSchemeInternal ),
232
232
},
233
233
},
234
- wantErr : errors .New ("unable to resolve at least one subnet (0 match VPC and tags)" ),
234
+ wantErr : errors .New ("unable to resolve at least one subnet (0 match VPC and tags: [kubernetes.io/role/internal-elb])" ),
235
+ },
236
+ {
237
+ name : "ALB with no matching subnets (internet-facing)" ,
238
+ fields : fields {
239
+ vpcID : "vpc-1" ,
240
+ clusterName : "kube-cluster" ,
241
+ describeSubnetsAsListCalls : []describeSubnetsAsListCall {
242
+ {
243
+ input : & ec2sdk.DescribeSubnetsInput {
244
+ Filters : []* ec2sdk.Filter {
245
+ {
246
+ Name : awssdk .String ("vpc-id" ),
247
+ Values : awssdk .StringSlice ([]string {"vpc-1" }),
248
+ },
249
+ {
250
+ Name : awssdk .String ("tag:kubernetes.io/role/elb" ),
251
+ Values : awssdk .StringSlice ([]string {"" , "1" }),
252
+ },
253
+ },
254
+ },
255
+ output : nil ,
256
+ },
257
+ },
258
+ },
259
+ args : args {
260
+ opts : []SubnetsResolveOption {
261
+ WithSubnetsResolveLBType (elbv2model .LoadBalancerTypeApplication ),
262
+ WithSubnetsResolveLBScheme (elbv2model .LoadBalancerSchemeInternetFacing ),
263
+ },
264
+ },
265
+ wantErr : errors .New ("unable to resolve at least one subnet (0 match VPC and tags: [kubernetes.io/role/elb])" ),
235
266
},
236
267
{
237
268
name : "NLB with one matching subnet" ,
0 commit comments