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

Migrate over to new terraform SDK #16

Merged
merged 4 commits into from Oct 10, 2019
Merged

Conversation

masutaka
Copy link
Collaborator

@masutaka masutaka commented Oct 8, 2019

Per https://www.terraform.io/docs/extend/plugin-sdk.html.

It seemed to be a seamless upgrade.

@masutaka masutaka self-assigned this Oct 8, 2019
@kristofferahl kristofferahl added this to In progress in Work via automation Oct 9, 2019
@kristofferahl
Copy link
Owner

@masutaka Let me know when the PR is rebased and I'll have a look. Great work my friend!

@masutaka masutaka force-pushed the terraform-plugin-sdk branch 2 times, most recently from 3692c05 to 80ce7e9 Compare October 9, 2019 07:48
@masutaka masutaka marked this pull request as ready for review October 9, 2019 07:57
@masutaka
Copy link
Collaborator Author

masutaka commented Oct 9, 2019

@kristofferahl Please review!

go.mod Outdated Show resolved Hide resolved
The reason is the below:

$ go mod vendor

$ tf-sdk-migrator check
Checking Go runtime version ...
Go version 1.13.1: OK.
Checking whether provider uses Go modules...
Go modules in use: OK.
Checking version of github.com/hashicorp/terraform-plugin-sdk to determine if provider was already migrated...
Checking version of github.com/hashicorp/terraform used in provider...
Terraform version does not satisfy constraint >=0.12.7. Found Terraform version: 0.12.2
Checking whether provider uses deprecated SDK packages or identifiers...
No imports of deprecated SDK packages or identifiers: OK.

Some constraints not satisfied. Please resolve these before migrating to the new SDK.

$ go get github.com/hashicorp/terraform

$ tf-sdk-migrator check
Checking Go runtime version ...
Go version 1.13.1: OK.
Checking whether provider uses Go modules...
Go modules in use: OK.
Checking version of github.com/hashicorp/terraform-plugin-sdk to determine if provider was already migrated...
Checking version of github.com/hashicorp/terraform used in provider...
Terraform version 0.12.10: OK.
Checking whether provider uses deprecated SDK packages or identifiers...
No imports of deprecated SDK packages or identifiers: OK.

All constraints satisfied. Provider can be migrated to the new SDK.
Checking Go runtime version ...
Go version 1.13.1: OK.
Checking whether provider uses Go modules...
Go modules in use: OK.
Checking version of github.com/hashicorp/terraform-plugin-sdk to determine if provider was already migrated...
Checking version of github.com/hashicorp/terraform used in provider...
Terraform version 0.12.10: OK.
Checking whether provider uses deprecated SDK packages or identifiers...
No imports of deprecated SDK packages or identifiers: OK.

All constraints satisfied. Provider can be migrated to the new SDK.

Rewriting provider go.mod file...
Rewriting SDK package imports...
Running `go mod tidy`...
Success! Provider is migrated to github.com/hashicorp/terraform-plugin-sdk v1.1.0.

It looks like this provider vendors dependencies. Don't forget to run `go mod vendor`.
Make sure to review all changes and run all tests.
@masutaka
Copy link
Collaborator Author

Please review it again.

FYI: Many of the changes in go.sum are due to go mod tidy. It executed in $ tf-sdk-migrator migrate.

Copy link
Owner

@kristofferahl kristofferahl left a comment

Choose a reason for hiding this comment

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

Looks great @masutaka! Had to make some changes to the build in order to get it working (docker image layer caching is a paid feature it seems). Merging the PR!

@kristofferahl kristofferahl merged commit 80b1de2 into master Oct 10, 2019
Work automation moved this from In progress to Done Oct 10, 2019
@kristofferahl kristofferahl deleted the terraform-plugin-sdk branch October 10, 2019 07:37
@kristofferahl
Copy link
Owner

@masutaka Should we create a new release?

@masutaka
Copy link
Collaborator Author

Yes, it's good.

@kristofferahl
Copy link
Owner

Created a new release with the tag v1.4.0.
https://github.com/kristofferahl/terraform-provider-healthchecksio/releases/tag/v1.4.0
Great work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Work
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

2 participants