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 @@ -827,24 +827,6 @@ func mockedDeleteVPCCallsForNonExistentVPC(m *mocks.MockEC2APIMockRecorder) {
827827}
828828
829829func mockedDeleteVPCCalls (m * mocks.MockEC2APIMockRecorder ) {
830- m .DescribeVpcEndpointsPages (gomock .Eq (& ec2.DescribeVpcEndpointsInput {
831- Filters : []* ec2.Filter {
832- {
833- Name : aws .String ("vpc-id" ),
834- Values : aws .StringSlice ([]string {"vpc-exists" }),
835- },
836- }}),
837- gomock .Any ()).Do (func (_ , y interface {}) {
838- funct := y .(func (page * ec2.DescribeVpcEndpointsOutput , lastPage bool ) bool )
839- funct (& ec2.DescribeVpcEndpointsOutput {VpcEndpoints : []* ec2.VpcEndpoint {{
840- VpcEndpointId : aws .String ("vpce-12345" ),
841- }}}, true )
842- }).Return (nil ).AnyTimes ()
843-
844- m .DeleteVpcEndpoints (gomock .Eq (& ec2.DeleteVpcEndpointsInput {
845- VpcEndpointIds : aws .StringSlice ([]string {"vpce-12345" }),
846- })).Return (& ec2.DeleteVpcEndpointsOutput {}, nil ).AnyTimes ()
847-
848830 m .DescribeSubnetsWithContext (context .TODO (), gomock .Eq (& ec2.DescribeSubnetsInput {
849831 Filters : []* ec2.Filter {
850832 {
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