Skip to content

fix: Exclude spot instances from shadeform - #157

Merged
drewmalin merged 1 commit into
mainfrom
BREV-12223/fix-shadeform-instancetype-filtering
Sep 17, 2026
Merged

drewmalin merged 1 commit into
mainfrom
BREV-12223/fix-shadeform-instancetype-filtering

Conversation

@aditsharma55

Copy link
Copy Markdown
Contributor

On the Brev console, certain Shadeform Instance Types (e.g. excesssupply_B300_sxm6x8) were showing up as available, but every provision attempt failed with the error zone has insufficient resources to fulfill the request, InsufficientCapacity.

Issue:

Shadeform returns one availability entry per rental type, so a region can appear twice, once "on_demand" and once "spot", with different available values. The syncer copied each entry's available flag into "IsAvailable" without checking rental type, so a region available only as spot (available: true) marked the whole SKU as available. Since Brev provisions on-demand only, these SKUs looked bookable but always failed at create time.

Fix:

  • Skipped spot availability entries when converting Shadeform instance types, so only on-demand entries drive IsAvailable.
  • Read rental_type from the generated Availability.AdditionalProperties map (the vendored OpenAPI client doesn't model the field yet as it seems to be outdated), with a note to switch to the typed field if the client is regenerated.
  • Added unit tests covering the B300 spot/on-demand case plus regression guards.

@aditsharma55
aditsharma55 requested a review from a team as a code owner September 17, 2026 00:25
@aditsharma55 aditsharma55 self-assigned this Sep 17, 2026
@drewmalin
drewmalin merged commit 3c23448 into main Sep 17, 2026
4 checks passed
@drewmalin
drewmalin deleted the BREV-12223/fix-shadeform-instancetype-filtering branch September 17, 2026 19:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants