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) {
14761476}
14771477
14781478func 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 ()
14791491 m .DescribeSubnetsWithContext (context .TODO (), gomock .Eq (& ec2.DescribeSubnetsInput {
14801492 Filters : []* ec2.Filter {
14811493 {
Original file line number Diff line number Diff line change @@ -276,17 +276,8 @@ 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-
288279 // Get all existing endpoints.
289- endpoints , err := s .describeVPCEndpoints ()
280+ endpoints , err := s .describeVPCEndpoints (filter . EC2 . ClusterOwned ( s . scope . Name ()) )
290281 if err != nil {
291282 return errors .Wrap (err , "failed to describe vpc endpoints" )
292283 }
You can’t perform that action at this time.
0 commit comments