Skip to content

Commit 43ab312

Browse files
author
jwcesign
committed
fix: allow ClosedWithStock capacity type
Signed-off-by: jwcesign <jwcesign@cloudpilot.ai>
1 parent daf31f6 commit 43ab312

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
@@ -318,7 +318,9 @@ func processAvailableResourcesResponse(resp *ecsclient.DescribeAvailableResource
318318
for _, az := range resp.Body.AvailableZones.AvailableZone {
319319
// TODO: Later, `ClosedWithStock` will be tested to determine if `ClosedWithStock` should be added.
320320
// WithStock, ClosedWithStock, WithoutStock, ClosedWithoutStock
321-
if *az.StatusCategory != "WithStock" {
321+
// ClosedWithStock means there is available capacity, just the provider will not add more capacity.
322+
if tea.StringValue(az.StatusCategory) != "WithStock" &&
323+
tea.StringValue(az.StatusCategory) != "ClosedWithStock" {
322324
continue
323325
}
324326
processAvailableResources(az, offerings)
@@ -339,7 +341,9 @@ func processAvailableResources(az *ecsclient.DescribeAvailableResourceResponseBo
339341
for _, sr := range ar.SupportedResources.SupportedResource {
340342
// TODO: Later, `ClosedWithStock` will be tested to determine if `ClosedWithStock` should be added.
341343
// WithStock, ClosedWithStock, WithoutStock, ClosedWithoutStock
342-
if *sr.StatusCategory != "WithStock" {
344+
// ClosedWithStock means there is available capacity, just the provider will not add more capacity.
345+
if tea.StringValue(sr.StatusCategory) != "WithStock" &&
346+
tea.StringValue(sr.StatusCategory) != "ClosedWithStock" {
343347
continue
344348
}
345349
if _, ok := instanceTypesOfferings[*sr.Value]; !ok {

0 commit comments

Comments
 (0)