-
Notifications
You must be signed in to change notification settings - Fork 639
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
v5.0.0 Grit migration not working #4966
Comments
Community NoteVoting for Prioritization
Volunteering to Work on This Issue
|
Thank you for reporting this issue! For maintainers to dig into issues it is required that all issues include the entirety of This issue has been marked with |
Terraform logs are not relevant to this issue |
Can confirm the same issue is present on my end. I have even less patterns than what @MattJeanes has shown. EDIT: I also tried this from the branch containing the update to cloudflare 5.x to make sure, this provided the same result. |
I don't know if adding this to your local repos version: 0.0.1
patterns:
- name: github.com/getgrit/stdlib#*
+ - name: github.com/cloudflare/terraform-provider-cloudflare#* |
there are a few things still in flight here (default branch cleanup, stdlib updates) so for now you can use |
No dice unfortunately - I looked up Grit's documentation couldn't seem to find any way to load stuff from another branch which that migration seems to sit on so it's trying to load it from main where it doesn't exist when I do that (I think)
|
@MattJeanes that may be a grit problem then. it's working for me locally however, i have had issues in the past with it not finding patterns outside of a |
Huh - that does actually seem to do the trick! Weird! Although still didn't actually change anything in my environment like the example above in my original issue I would have thought it would change to the new name, unless that's unsupported for some reason? I guess if it's still being worked on we'll have to wait and see. In my test scenario all of my Cloudflare provider resources are
|
i don't understand why grit has that issue (i've tried to debug in the past with no heading) but that occasionally fixes it for me. we mention this in the migration docs but we don't automatically migrate resource renames as it's not safe for all resources to be performed in place. you can check out the options and steps at https://registry.terraform.io/providers/cloudflare/cloudflare/latest/docs/guides/version-5-upgrade#resource-renames. the patterns for v5 are:
(these make more sense after you read the doc and choose your path) |
The instruction on https://registry.terraform.io/providers/cloudflare/cloudflare/latest/docs/guides/version-5-upgrade is wrong:
|
@tchwpkgorg please read the previous comments; this is known and has already been fixed awaiting a release. you can call the patterns directly in the meantime to achieve the same thing. |
#4966 (comment) that solved the problem, thanks @MattJeanes! |
It seems like we should update the documentation around both the grit init --global and also updating the local .grit/grit.yaml, because it doesn't say anything about this last I checked and seems to be causing some confusion. Maybe also worth noting better about the resource name/state file migration as I was under the assumption that the V5 migration would do all the migrations for V5 I would understand this more for a pre-release version but now 5.0.0 is in full release and basically everyone who uses it is going to have to do some migrations manually or otherwise the docs should probably be a bit clearer |
you shouldn't need re: the grit URL to use, that was fixed shortly after 5.0.0 was released. the documentation is dependent on a new version ring release for it to appear in the registry. in the meantime, you can use the git branches or release PR for the most up to date guidance. |
Still no luck...
|
closing this one as the grit migrations as documented in |
Please make sure you use the right name. It is
|
Confirmation
Terraform and Cloudflare provider version
Terraform v1.10.3
on windows_amd64
Affected resource(s)
But affects everything from the migration
Terraform configuration files
Link to debug output
N/A
Panic output
N/A
Expected output
The Grit migration will run successfully
Actual output
Thie Grit migration is not found
Steps to reproduce
https://registry.terraform.io/providers/cloudflare/cloudflare/latest/docs/guides/version-5-upgrade#automatic-migration
ERROR (code: 200) - pattern definition not found: cloudflare_terraform_v5. Try running grit init.
(NOTE:
grit init
did not help)Additional factoids
I also tried adding this repo to the Grit config file and it nows shows other migrations but not the V5 upgrade one:
I also even tried taking the file from https://github.com/cloudflare/terraform-provider-cloudflare/tree/gritql-v5/.grit/patterns and putting that in my own .grit/patterns which it then recognised and ran with
grit apply terraform_cloudflare_v5
but didn't actually change anything:References
No response
The text was updated successfully, but these errors were encountered: