Skip to content
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

add provider implementations of tencentcloud #125

Merged
merged 2 commits into from
Nov 19, 2019
Merged

add provider implementations of tencentcloud #125

merged 2 commits into from
Nov 19, 2019

Conversation

likexian
Copy link
Contributor

@likexian likexian commented Sep 2, 2019

Hello,

This PR provides a new provider implementations of TencentCloud in the go-discover/provider sub packages.

About TencentCloud

Tencent Cloud is a secure, reliable and high-performance cloud compute service provided by Tencent. It is the 2st largest Cloud Provider in China.

@likexian
Copy link
Contributor Author

likexian commented Sep 2, 2019

go test -v ./provider/tencentcloud/
=== RUN   TestAddrs
2019/09/02 19:57:59 [DEBUG] discover-tencentcloud: Using region=ap-guangzhou, tag_key=consul, tag_value=test
2019/09/02 19:57:59 [DEBUG] discover-tencentcloud: Static credentials provided
2019/09/02 19:57:59 [DEBUG] discover-tencentcloud: region is ap-guangzhou
2019/09/02 19:57:59 [DEBUG] discover-tencentcloud: address type is private_v4
2019/09/02 19:57:59 [DEBUG] discover-tencentcloud: Filter instances with consul=test
2019/09/02 19:58:00 [DEBUG] discover-tencentcloud: Found 2 instances
2019/09/02 19:58:00 [DEBUG] discover-tencentcloud: Instance ins-kj81nmyo has private_v4 172.16.0.26
2019/09/02 19:58:00 [DEBUG] discover-tencentcloud: Instance ins-qgatl4is has private_v4 172.16.0.76
2019/09/02 19:58:00 [DEBUG] discover-tencentcloud: Found address: [172.16.0.26 172.16.0.76]
--- PASS: TestAddrs (0.41s)
PASS
ok      github.com/hashicorp/go-discover/provider/tencentcloud  0.423s

@hanshasselberg hanshasselberg requested a review from a team September 4, 2019 10:45
@hanshasselberg
Copy link
Member

hanshasselberg commented Sep 4, 2019

Thank you @likexian for your work! We will have a look soon!

@likexian
Copy link
Contributor Author

likexian commented Oct 9, 2019

Hello,
Would someone please take a review of this PR?

@alvin-huang
Copy link
Contributor

I hooked this up to our CI with credentials for Tencentcloud and it passed the provider tests. @hashicorp/consul-core can someone have a look through the Go code?

Copy link
Member

@banks banks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @likexian!

Thanks for your patience while we worked out the testing and account gymnastics needed here for on-going support.

This looks great, I've just commented on a couple of super minor things that it would be good to clean up before we merge. Mostly removing an unnecessary dep since all of HashiCorps products end up importing everything here transitively.

Hopefully the small changes requested should take no more than a few minutes and then we can get this merged!

provider/tencentcloud/tencentcloud_discover.go Outdated Show resolved Hide resolved
provider/tencentcloud/tencentcloud_discover.go Outdated Show resolved Hide resolved
provider/tencentcloud/tencentcloud_discover_test.go Outdated Show resolved Hide resolved
@likexian
Copy link
Contributor Author

Hello @banks
Thank you for your help, I have resolved the issue about dependency.

The testing after changed passed, please have a review.

=== RUN   TestAddrs
2019/11/19 10:36:48 [DEBUG] discover-tencentcloud: Using region=ap-guangzhou, tag_key=consul, tag_value=test
2019/11/19 10:36:48 [DEBUG] discover-tencentcloud: Static credentials provided
2019/11/19 10:36:48 [DEBUG] discover-tencentcloud: region is ap-guangzhou
2019/11/19 10:36:48 [DEBUG] discover-tencentcloud: address type is private_v4
2019/11/19 10:36:48 [DEBUG] discover-tencentcloud: Filter instances with consul=test
2019/11/19 10:36:49 [DEBUG] discover-tencentcloud: Found 2 instances
2019/11/19 10:36:49 [DEBUG] discover-tencentcloud: Instance ins-i7ugrga0 has private_v4 172.16.0.144
2019/11/19 10:36:49 [DEBUG] discover-tencentcloud: Instance ins-ju9pzua2 has private_v4 172.16.0.90
2019/11/19 10:36:49 [DEBUG] discover-tencentcloud: Found address: [172.16.0.144 172.16.0.90]
--- PASS: TestAddrs (0.88s)
PASS
ok      github.com/hashicorp/go-discover/provider/tencentcloud  0.939s

Copy link
Member

@banks banks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @likexian, this looks great!

@banks banks merged commit a6f2d36 into hashicorp:master Nov 19, 2019
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.

4 participants