-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix pricing endpoint in AWS China Region #3528
Conversation
30dfb9c
to
7c44ff3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
very good
Add pricing list api here. Thanks for the contribution
|
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Jeffwan The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
staticListLastUpdateTime = "2019-10-14" | ||
ec2MetaDataServiceUrl = "http://169.254.169.254/latest/dynamic/instance-identity/document" | ||
ec2PricingServiceUrlTemplate = "https://pricing.us-east-1.amazonaws.com/offers/v1.0/aws/AmazonEC2/current/%s/index.json" | ||
ec2PricingServiceUrlTemplateCN = "https://pricing.cn-north-1.amazonaws.com.cn/offers/v1.0/cn/AmazonEC2/current/%s/index.json" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor: There're multiple partitions like AWS, AWS-cn, AWS-gov. It would be great to have all of them
@@ -53,6 +54,13 @@ type productAttributes struct { | |||
|
|||
// GenerateEC2InstanceTypes returns a map of ec2 resources | |||
func GenerateEC2InstanceTypes(region string) (map[string]*InstanceType, error) { | |||
var pricingUrlTemplate string | |||
if strings.HasPrefix(region, "cn-") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor: I am ok with this now. It would be better to use AWS SDK to check partition
@zxh326 Why not to use cherry-picks scripts? |
I don't know how to use and didn't find this script |
is it available in 1.18? I still have this issue in 1.18:
|
@yongzhang Looks like the backport to 1.18 hasn't been released yet. cluster-autoscaler-1.18.3...cluster-autoscaler-release-1.18 |
Fine, so looks like I have to build the binary from branch |
Fixes #3076, #3276