From 379006c06d8ddc30b1bb8cbc82548ffe6b129f72 Mon Sep 17 00:00:00 2001 From: s3rj1k Date: Mon, 28 Oct 2024 18:33:43 +0100 Subject: [PATCH] Remove owned VPCEs when deleting VPC. --- pkg/cloud/services/network/vpc.go | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/pkg/cloud/services/network/vpc.go b/pkg/cloud/services/network/vpc.go index 1e01961e83..8b2d37cfe4 100644 --- a/pkg/cloud/services/network/vpc.go +++ b/pkg/cloud/services/network/vpc.go @@ -276,17 +276,8 @@ func (s *Service) deleteVPCEndpoints() error { return nil } - // Gather all services that might have been enabled. - services := sets.New[string]() - if s.scope.Bucket() != nil { - services.Insert(fmt.Sprintf("com.amazonaws.%s.s3", s.scope.Region())) - } - if services.Len() == 0 { - return nil - } - // Get all existing endpoints. - endpoints, err := s.describeVPCEndpoints() + endpoints, err := s.describeVPCEndpoints(filter.EC2.Cluster(s.scope.Name())) if err != nil { return errors.Wrap(err, "failed to describe vpc endpoints") }