Skip to content

Commit dde7dc7

Browse files
committed
fix: allow ClosedWithStock capacity type
Signed-off-by: jwcesign <[email protected]>
1 parent d5310c7 commit dde7dc7

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

pkg/providers/instancetype/instancetype.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,9 @@ func processAvailableResourcesResponse(resp *ecsclient.DescribeAvailableResource
321321
for _, az := range resp.Body.AvailableZones.AvailableZone {
322322
// TODO: Later, `ClosedWithStock` will be tested to determine if `ClosedWithStock` should be added.
323323
// WithStock, ClosedWithStock, WithoutStock, ClosedWithoutStock
324-
if *az.StatusCategory != "WithStock" {
324+
// ClosedWithStock means there is available capacity, just the provider will not add more capacity.
325+
if tea.StringValue(az.StatusCategory) != "WithStock" &&
326+
tea.StringValue(az.StatusCategory) != "ClosedWithStock" {
325327
continue
326328
}
327329
processAvailableResources(az, offerings)
@@ -342,7 +344,9 @@ func processAvailableResources(az *ecsclient.DescribeAvailableResourceResponseBo
342344
for _, sr := range ar.SupportedResources.SupportedResource {
343345
// TODO: Later, `ClosedWithStock` will be tested to determine if `ClosedWithStock` should be added.
344346
// WithStock, ClosedWithStock, WithoutStock, ClosedWithoutStock
345-
if *sr.StatusCategory != "WithStock" {
347+
// ClosedWithStock means there is available capacity, just the provider will not add more capacity.
348+
if tea.StringValue(sr.StatusCategory) != "WithStock" &&
349+
tea.StringValue(sr.StatusCategory) != "ClosedWithStock" {
346350
continue
347351
}
348352
if _, ok := instanceTypesOfferings[*sr.Value]; !ok {

0 commit comments

Comments
 (0)