File tree Expand file tree Collapse file tree 2 files changed +13
-10
lines changed
pkg/cloud/services/network Expand file tree Collapse file tree 2 files changed +13
-10
lines changed Original file line number Diff line number Diff line change @@ -1476,6 +1476,18 @@ func mockedDeleteVPCCallsForNonExistentVPC(m *mocks.MockEC2APIMockRecorder) {
1476
1476
}
1477
1477
1478
1478
func mockedDeleteVPCCalls (m * mocks.MockEC2APIMockRecorder ) {
1479
+ m .DescribeVpcEndpointsPages (gomock .Eq (& ec2.DescribeVpcEndpointsInput {
1480
+ Filters : []* ec2.Filter {
1481
+ {
1482
+ Name : aws .String ("tag:sigs.k8s.io/cluster-api-provider-aws/cluster/test-cluster" ),
1483
+ Values : []* string {aws .String ("owned" )},
1484
+ },
1485
+ {
1486
+ Name : aws .String ("vpc-id" ),
1487
+ Values : []* string {aws .String ("vpc-exists" )},
1488
+ },
1489
+ },
1490
+ }), gomock .Any ()).Return (nil ).AnyTimes ()
1479
1491
m .DescribeSubnetsWithContext (context .TODO (), gomock .Eq (& ec2.DescribeSubnetsInput {
1480
1492
Filters : []* ec2.Filter {
1481
1493
{
Original file line number Diff line number Diff line change @@ -276,17 +276,8 @@ func (s *Service) deleteVPCEndpoints() error {
276
276
return nil
277
277
}
278
278
279
- // Gather all services that might have been enabled.
280
- services := sets .New [string ]()
281
- if s .scope .Bucket () != nil {
282
- services .Insert (fmt .Sprintf ("com.amazonaws.%s.s3" , s .scope .Region ()))
283
- }
284
- if services .Len () == 0 {
285
- return nil
286
- }
287
-
288
279
// Get all existing endpoints.
289
- endpoints , err := s .describeVPCEndpoints ()
280
+ endpoints , err := s .describeVPCEndpoints (filter . EC2 . ClusterOwned ( s . scope . Name ()) )
290
281
if err != nil {
291
282
return errors .Wrap (err , "failed to describe vpc endpoints" )
292
283
}
You can’t perform that action at this time.
0 commit comments