mirror of https://github.com/kubernetes/kops.git
Ignore any duplicates being returned by the pricing API when rebuilding machine types
This commit is contained in:
parent
c2d82abd88
commit
aa34956560
|
|
@ -153,6 +153,7 @@ func run() error {
|
|||
}
|
||||
}
|
||||
|
||||
seen := map[string]bool{}
|
||||
for _, item := range prices {
|
||||
for k, v := range item {
|
||||
if k == "product" {
|
||||
|
|
@ -162,6 +163,11 @@ func run() error {
|
|||
attributes[k] = v.(string)
|
||||
}
|
||||
|
||||
if _, ok := seen[attributes["instanceType"]]; ok {
|
||||
continue
|
||||
}
|
||||
seen[attributes["instanceType"]] = true
|
||||
|
||||
machine := awsup.AWSMachineTypeInfo{
|
||||
Name: attributes["instanceType"],
|
||||
Cores: stringToInt(attributes["vcpu"]),
|
||||
|
|
|
|||
Loading…
Reference in New Issue