Skip to content

Commit 31b8965

Browse files
committed
fix: consider vs zones when creating types offerings
Signed-off-by: jwcesign <[email protected]>
1 parent 94b161e commit 31b8965

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

pkg/providers/instancetype/instancetype.go

+4-2
Original file line numberDiff line numberDiff line change
@@ -185,11 +185,13 @@ func (p *DefaultProvider) List(ctx context.Context, kc *v1alpha1.KubeletConfigur
185185

186186
result := lo.Map(p.instanceTypesInfo, func(i *ecsclient.DescribeInstanceTypesResponseBodyInstanceTypesInstanceType, _ int) *cloudprovider.InstanceType {
187187
zoneData := lo.Map(allZones.UnsortedList(), func(zoneID string, _ int) ZoneData {
188-
ret := ZoneData{ID: zoneID, Available: true}
188+
ret := ZoneData{ID: zoneID, Available: true, SpotAvailable: true}
189189
if !p.instanceTypesOfferings[lo.FromPtr(i.InstanceTypeId)].Has(zoneID) || !vSwitchsZones.Has(zoneID) {
190190
ret.Available = false
191191
}
192-
ret.SpotAvailable = p.spotInstanceTypesOfferings[lo.FromPtr(i.InstanceTypeId)].Has(zoneID)
192+
if !p.spotInstanceTypesOfferings[lo.FromPtr(i.InstanceTypeId)].Has(zoneID) || !vSwitchsZones.Has(zoneID) {
193+
ret.SpotAvailable = false
194+
}
193195
return ret
194196
})
195197

0 commit comments

Comments
 (0)