Repository navigation
fix: default empty Provider to tencentcloud in ExpectedCurrencyFor - #8
Merged
susunola merged 1 commit intoAug 3, 2026
Merged
Conversation
Tencent Cloud mappers do not set the Provider field on PriceRequest
(predating multi-cloud support). ExpectedCurrencyFor("") fell through
to the default "CNY" even when --site intl was specified, causing CBS,
CLB, CynosDB, CVM, DCDB, EIP, MariaDB and VPN to report CNY instead
of USD on international site.
Fix: treat empty provider as "tencentcloud", consistent with the
existing provider() method convention.
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.
Problem
Tencent Cloud mappers do not set the
Providerfield onPriceRequest(predating multi-cloud support). WhenExpectedCurrencyFor("")is called, the empty string doesn't matchcase "tencentcloud"in the switch statement, so it falls through to the default"CNY"— even when--site intlis specified.This causes CBS, CLB, CynosDB, CVM, DCDB, EIP, MariaDB, and VPN Gateway to incorrectly report CNY instead of USD on the international site.
Root Cause
ExpectedCurrencyFor(""):""" != "tencentcloud"→ falls through → returns"CNY"Fix
Treat empty provider as
"tencentcloud"at the top ofExpectedCurrencyFor, consistent with the existingprovider()method convention that already treats empty as tencentcloud.Before / After
All tests pass (
go test ./...).