mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-31 15:25:57 +00:00
Don't assume every AWS VPC has tags
The default VPC has no tags (by default), so we should use get()
This commit is contained in:
parent
7eceafa656
commit
f9a9c75697
@ -33,7 +33,7 @@ function get_instance_ids {
|
||||
}
|
||||
|
||||
function get_vpc_id {
|
||||
python -c 'import json,sys; lst = [str(vpc["VpcId"]) for vpc in json.load(sys.stdin)["Vpcs"] for tag in vpc["Tags"] if tag["Value"] == "kubernetes-vpc"]; print "".join(lst)'
|
||||
python -c 'import json,sys; lst = [str(vpc["VpcId"]) for vpc in json.load(sys.stdin)["Vpcs"] for tag in vpc.get("Tags", []) if tag["Value"] == "kubernetes-vpc"]; print "".join(lst)'
|
||||
}
|
||||
|
||||
function get_subnet_id {
|
||||
|
Loading…
Reference in New Issue
Block a user