File tree Expand file tree Collapse file tree 2 files changed +9
-18
lines changed
pkg/cloud/services/network Expand file tree Collapse file tree 2 files changed +9
-18
lines changed Original file line number Diff line number Diff line change @@ -1437,24 +1437,6 @@ func mockedDeleteVPCCallsForNonExistentVPC(m *mocks.MockEC2APIMockRecorder) {
1437
1437
}
1438
1438
1439
1439
func mockedDeleteVPCCalls (m * mocks.MockEC2APIMockRecorder ) {
1440
- m .DescribeVpcEndpointsPages (gomock .Eq (& ec2.DescribeVpcEndpointsInput {
1441
- Filters : []* ec2.Filter {
1442
- {
1443
- Name : aws .String ("vpc-id" ),
1444
- Values : aws .StringSlice ([]string {"vpc-exists" }),
1445
- },
1446
- }}),
1447
- gomock .Any ()).Do (func (_ , y interface {}) {
1448
- funct := y .(func (page * ec2.DescribeVpcEndpointsOutput , lastPage bool ) bool )
1449
- funct (& ec2.DescribeVpcEndpointsOutput {VpcEndpoints : []* ec2.VpcEndpoint {{
1450
- VpcEndpointId : aws .String ("vpce-12345" ),
1451
- }}}, true )
1452
- }).Return (nil ).AnyTimes ()
1453
-
1454
- m .DeleteVpcEndpoints (gomock .Eq (& ec2.DeleteVpcEndpointsInput {
1455
- VpcEndpointIds : aws .StringSlice ([]string {"vpce-12345" }),
1456
- })).Return (& ec2.DeleteVpcEndpointsOutput {}, nil ).AnyTimes ()
1457
-
1458
1440
m .DescribeSubnetsWithContext (context .TODO (), gomock .Eq (& ec2.DescribeSubnetsInput {
1459
1441
Filters : []* ec2.Filter {
1460
1442
{
Original file line number Diff line number Diff line change @@ -276,6 +276,15 @@ 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
+
279
288
// Get all existing endpoints.
280
289
endpoints , err := s .describeVPCEndpoints ()
281
290
if err != nil {
You can’t perform that action at this time.
0 commit comments