mirror of https://github.com/kubernetes/kops.git
Fix unsetting ASG max price
This commit is contained in:
parent
9a3e86ca31
commit
2e46fdee1b
|
@ -539,7 +539,12 @@ func (b *AutoscalingGroupModelBuilder) buildAutoScalingGroupTask(c *fi.ModelBuil
|
||||||
t.MixedOnDemandBase = spec.OnDemandBase
|
t.MixedOnDemandBase = spec.OnDemandBase
|
||||||
t.MixedSpotAllocationStrategy = spec.SpotAllocationStrategy
|
t.MixedSpotAllocationStrategy = spec.SpotAllocationStrategy
|
||||||
t.MixedSpotInstancePools = spec.SpotInstancePools
|
t.MixedSpotInstancePools = spec.SpotInstancePools
|
||||||
t.MixedSpotMaxPrice = ig.Spec.MaxPrice
|
// In order to unset maxprice, the value needs to be ""
|
||||||
|
if ig.Spec.MaxPrice == nil {
|
||||||
|
t.MixedSpotMaxPrice = fi.String("")
|
||||||
|
} else {
|
||||||
|
t.MixedSpotMaxPrice = ig.Spec.MaxPrice
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return t, nil
|
return t, nil
|
||||||
|
|
|
@ -363,7 +363,8 @@
|
||||||
},
|
},
|
||||||
"InstancesDistribution": {
|
"InstancesDistribution": {
|
||||||
"OnDemandPercentageAboveBaseCapacity": 5,
|
"OnDemandPercentageAboveBaseCapacity": 5,
|
||||||
"SpotInstancePools": 3
|
"SpotInstancePools": 3,
|
||||||
|
"SpotMaxPrice": ""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -296,6 +296,7 @@ resource "aws_autoscaling_group" "nodes-mixedinstances-example-com" {
|
||||||
instances_distribution {
|
instances_distribution {
|
||||||
on_demand_percentage_above_base_capacity = 5
|
on_demand_percentage_above_base_capacity = 5
|
||||||
spot_instance_pools = 3
|
spot_instance_pools = 3
|
||||||
|
spot_max_price = ""
|
||||||
}
|
}
|
||||||
launch_template {
|
launch_template {
|
||||||
launch_template_specification {
|
launch_template_specification {
|
||||||
|
|
|
@ -218,6 +218,10 @@ func (e *AutoscalingGroup) Find(c *fi.Context) (*AutoscalingGroup, error) {
|
||||||
actual.MixedSpotAllocationStrategy = mpd.SpotAllocationStrategy
|
actual.MixedSpotAllocationStrategy = mpd.SpotAllocationStrategy
|
||||||
actual.MixedSpotInstancePools = mpd.SpotInstancePools
|
actual.MixedSpotInstancePools = mpd.SpotInstancePools
|
||||||
actual.MixedSpotMaxPrice = mpd.SpotMaxPrice
|
actual.MixedSpotMaxPrice = mpd.SpotMaxPrice
|
||||||
|
// MixedSpotMaxPrice must be set to "" in order to unset.
|
||||||
|
if mpd.SpotMaxPrice == nil {
|
||||||
|
actual.MixedSpotMaxPrice = fi.String("")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if g.MixedInstancesPolicy.LaunchTemplate != nil {
|
if g.MixedInstancesPolicy.LaunchTemplate != nil {
|
||||||
|
|
Loading…
Reference in New Issue