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

Rename provider #85

Merged
merged 2 commits into from
Jun 15, 2018
Merged

Rename provider #85

merged 2 commits into from
Jun 15, 2018

Conversation

mevansam
Copy link
Member

Pull request addressing issues: #44 and #66

@mevansam mevansam changed the base branch from master to dev May 29, 2018 17:11
Copy link
Collaborator

@gberche-orange gberche-orange left a comment

Choose a reason for hiding this comment

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

thanks @mevansam looks good to me. The failed test may require a merge of #89

For users such as @janosbinder that started to use mevansam/terraform-provider-cf in production, we should document a migration guide:

  • TF specs need provider, resources and datasource renames
  • TF state file requires
    • Provider rename
    • Resources rename

I suggest to track this into a distinct issue to merge #85 asap.

layout: "cf"
page_title: "Cloud Foundry: cf_user_provided_service"
layout: "cloudfoundry"
page_title: "Cloud Foundry: cloudfoundry_user_provided_service"
sidebar_current: "docs-cf-resource-user-provided-service"
Copy link
Collaborator

Choose a reason for hiding this comment

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

I assume the sidebar_current ids are defined in cf.erb and therefore don't need renames

Copy link
Member Author

@mevansam mevansam Jun 9, 2018

Choose a reason for hiding this comment

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

For backward compatibility would it make sense to register providers under the cf_* name a well as cloudfoundry_*, until @janosbinder has moved over to the new naming convention? Theoretically, it should work but I have not tested it but wanted to validate if this has already been experimented with at Orange.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@mevansam I would suggest to keep the provider code simple and compliant to hashicorp guidelines, and rather rely on beta users of mevansam/terraform-provider-cf to upgrade themselves using the procedure @janosbinder kindly contributed.

Copy link
Member

Choose a reason for hiding this comment

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

I do agree with @gberche-orange this is more complexity for us to maintain than for user to do the changes. In add, we will never remove it to ensure compatibility by doing. I think that the sooner the better here.

@janosbinder
Copy link
Collaborator

@gberche-orange @mevansam I think the necessary steps for migration are:

0, back up the tf files and the terraform.tfstate file
1, in all tf files replace resource/data "cf_..." with "cloudfoundry_...". For example sed 's#resource \"cf_#resource \"cloudfoundry_#g' old.tf | sed 's#data \"cf_#data \"cloudfoundry_#g'
2, in the terraform.tfstate file replace the types. For example "type": "cf_service_instance" should be replaced with "type": "cloudfoundry_service_instance"
3, in the terraform.tfstate file check the depends_on nodes and make the adjustments. For example

"depends_on": [
"data.cf_service.abc"
"cf_service_instance.xyz"
"cf_route.example"
],

Should be

"depends_on": [
"data.cloudfoundry_service.abc"
"cloudfoundry_service_instance.xyz"
"cloudfoundry_route.example"
],

4, if there are no errors after calling terraform plan, and no changes are planned to be applied then the migration was successful.

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.

None yet

4 participants