lyft / cni-ipvlan-vpc-k8s

AWS VPC Kubernetes CNI driver using IPvlan
Apache License 2.0
360 stars 58 forks source link

Filter subnets using a vpc-id as well #46

Closed ungureanuvladvictor closed 6 years ago

ungureanuvladvictor commented 6 years ago

Currently the code describes all the subnets in the AWS account filtering just by AZ. This works well if you only have one VPC per account. In my case I had 2 VPCs with subnets in the AZ that the code wanted to filter by. This caused the plugin to ask AWS to create a ENI with a SG from one VPC and a subnet from the other VPC.

lbernail commented 6 years ago

I had the same issue and worked around it by tagging the subnets to use Definite 👍

theatrus commented 6 years ago

Thanks, looks reasonable to me :)

theatrus commented 6 years ago

You'll need to either mock or skip the test for CI as Travis doesn't run on AWS for the most part.

subnets_test.go:61: 0 Mock returned an error - is it mocked? failed to get interfaces associated with this EC2 machine: EC2 Metadata not available

chris-h-phillips commented 6 years ago

I made #51 that fixes the test