fix(hostinger): populate vcpus/memory_gb/disk_gb on instance_types - #2
Open
dviejokfs wants to merge 2 commits into
Open
fix(hostinger): populate vcpus/memory_gb/disk_gb on instance_types#2dviejokfs wants to merge 2 commits into
dviejokfs wants to merge 2 commits into
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
instance_types()hardcodedvcpus: 0, memory_gb: 0.0, disk_gb: 0for 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).known_specslookup 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 documentedmonthly_pricegap.known_specs.Test plan
cargo test -p nimbus-cloud hostinger— 6/6 passcargo test --workspace— 21/21 passcargo clippy --workspace --all-targets -- -D warnings— cleancargo fmt --checkon changed lines — clean (two pre-existing unrelated formatting diffs in the same file left untouched)