New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
aws: Filter ENI list by VPC #15903
aws: Filter ENI list by VPC #15903
Conversation
60417d3
to
630665f
Compare
pkg/resources/aws/eni.go
Outdated
@@ -79,6 +79,9 @@ func DescribeENIs(cloud fi.Cloud, clusterName string) (map[string]*ec2.NetworkIn | |||
request := &ec2.DescribeNetworkInterfacesInput{ | |||
Filters: append(filters, statusFilter), | |||
} | |||
if vpcID != "" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually, here we may as well return. there's no ENI without VPC and it's probably valid for most other things.
@@ -51,7 +51,7 @@ func DescribeRouteTables(cloud fi.Cloud, clusterName string) (map[string]*ec2.Ro | |||
return routeTables, nil | |||
} | |||
|
|||
func ListRouteTables(cloud fi.Cloud, clusterName string) ([]*resources.Resource, error) { | |||
func ListRouteTables(cloud fi.Cloud, vpcID, clusterName string) ([]*resources.Resource, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see that many of the functions are now taking vpc-id which is nice, not just in the eni.go
file but also in other files like sqs, routetable etc. What I'm trying to understand is, are we not using these functions anywhere else in the project ? Because I don't see any consumers of these functions are being changed to accommodate this change i.e; the callers ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are used only on cleanup, which is quite demanding.
vpc-id
can be used as a filter later in other places. For now, let's see how the review goes.
Thanks for adding these changes very quickly, as this will make life easier for us internally on large scale vpc's. Appreciate the efforts. |
630665f
to
1aecb53
Compare
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: johngmyers The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
This should add filtering by VPC for ENIs, which seems needed for scale tests, but also should be a nice addition.
https://kubernetes.slack.com/archives/CCK68P2Q2/p1694457549877619?thread_ts=1694437331.729519&cid=CCK68P2Q2
/cc @rifelpet @justinsb @dims