Skip to content

fix(hostinger): populate vcpus/memory_gb/disk_gb on instance_types - #2

Open
dviejokfs wants to merge 2 commits into
mainfrom
fix/hostinger-instance-type-specs
Open

fix(hostinger): populate vcpus/memory_gb/disk_gb on instance_types#2
dviejokfs wants to merge 2 commits into
mainfrom
fix/hostinger-instance-type-specs

Conversation

@dviejokfs

Copy link
Copy Markdown
Contributor

Summary

  • Hostinger's instance_types() hardcoded vcpus: 0, memory_gb: 0.0, disk_gb: 0 for every plan, because the billing catalog endpoint it queries never exposes hardware specs pre-purchase (specs only appear on a VM resource after it's created/purchased).
  • Downstream, this surfaced in temps-fleet's Hostinger provisioning UI as every plan card showing "0 vCPU / 0 GB / 0 GB" while names and prices rendered correctly.
  • Hostinger's VPS hardware is fixed per plan tier and identical across plan families (KVM and Game Panel share hardware, differing only in pre-installed software — confirmed against hostinger.com's public VPS and Game Panel/Minecraft pricing pages). Added a known_specs lookup keyed by the tier number parsed from the plan's display name (e.g. "KVM 2" / "Game Panel 2" → tier 2, 2 vCPU / 8 GB / 100 GB). Plans that don't match a known tier still fall back to 0, same as OVH's documented monthly_price gap.
  • Extended the mock catalog with a Game Panel entry (codenamed differently from KVM in the real API, per an inline comment) to prove tier parsing works across plan families, and added unit tests for known_specs.

Test plan

  • cargo test -p nimbus-cloud hostinger — 6/6 pass
  • cargo test --workspace — 21/21 pass
  • cargo clippy --workspace --all-targets -- -D warnings — clean
  • cargo fmt --check on changed lines — clean (two pre-existing unrelated formatting diffs in the same file left untouched)

Hostinger's billing catalog (used by instance_types) never exposes
hardware specs pre-purchase, so they were hardcoded to 0 for every
plan. VPS hardware is fixed per plan tier and identical across plan
families (KVM and Game Panel share hardware, differing only in
pre-installed software), so specs are now filled in from a static
table keyed by the tier number parsed from the plan's display name.

Verified against hostinger.com's public VPS and Game Panel pricing
pages. Plans that don't match a known tier still fall back to 0.
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.

1 participant