-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed as not planned
Labels
lifecycle/rottenDenotes an issue or PR that has aged beyond stale and will be auto-closed.Denotes an issue or PR that has aged beyond stale and will be auto-closed.
Description
This was introduced by @jeswinkoshyninan in #3656
It's not clear to my why --aws-vpc-tags
allows to pass a map with an arbitrary number of items if we only ever pass a single key-value pair (the one with the key specified in --aws-vpc-tag-key
) as the tag filter for finding a VPC.
aws-load-balancer-controller/pkg/aws/cloud.go
Lines 141 to 143 in 8a01478
if cfg.VpcTags != nil { | |
return inferVPCIDFromTags(ec2Service, cfg.VpcNameTagKey, cfg.VpcTags[cfg.VpcNameTagKey]) | |
} |
aws-load-balancer-controller/pkg/aws/cloud.go
Lines 184 to 192 in 8a01478
func inferVPCIDFromTags(ec2Service services.EC2, VpcNameTagKey string, VpcNameTagValue string) (string, error) { | |
vpcs, err := ec2Service.DescribeVPCsAsList(context.Background(), &ec2.DescribeVpcsInput{ | |
Filters: []*ec2.Filter{ | |
{ | |
Name: aws.String("tag:" + VpcNameTagKey), | |
Values: []*string{aws.String(VpcNameTagValue)}, | |
}, | |
}, | |
}) |
Shouldn't it rather just convert the map from --aws-vpc-tags
into a list of tag filters, one for each item? This would remove the need for --aws-vpc-tag-key
altogether.
Ref: #3656 (comment)
pinkavaj
Metadata
Metadata
Assignees
Labels
lifecycle/rottenDenotes an issue or PR that has aged beyond stale and will be auto-closed.Denotes an issue or PR that has aged beyond stale and will be auto-closed.