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) {
14371437}
14381438
14391439func 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-
14581440 m .DescribeSubnetsWithContext (context .TODO (), gomock .Eq (& ec2.DescribeSubnetsInput {
14591441 Filters : []* ec2.Filter {
14601442 {
Original file line number Diff line number Diff line change @@ -276,6 +276,15 @@ func (s *Service) deleteVPCEndpoints() error {
276276 return nil
277277 }
278278
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+
279288 // Get all existing endpoints.
280289 endpoints , err := s .describeVPCEndpoints ()
281290 if err != nil {
You can’t perform that action at this time.
0 commit comments