command: Add redirect support to 0.13upgrade#26061
Conversation
Codecov Report
|
command/013_config_upgrade.go
Outdated
| tfdiags.Warning, | ||
| "Provider has moved", | ||
| fmt.Sprintf( | ||
| "Provider %q has moved to %q. You will need to upgrade to a new version before changing the source.", |
There was a problem hiding this comment.
This could be unclear to users - do you mean upgrade terraform, or upgrade the pinned provider version? It's also not quite clear that this is optional. This is my awkward take at the message, it's not necessarily better, just want to see what you think:
"Provider %q has moved to %q. No action is required to continue using %q (provider) version %q (their constraint), but if you want to upgrade beyond version %s (last version available at the old location) you must also update the source:
There was a problem hiding this comment.
I think this is a great suggestion!
mildwonkey
left a comment
There was a problem hiding this comment.
This is a great update, thank you!
I left some nitpicky thoughts about the warning when the provider has moved but the config is pinned to the older (pre-move) version of the provider, but they are not meant to block merging - you can modify the message on your own, or not, and I still approve ✅
justincampbell
left a comment
There was a problem hiding this comment.
This looks great to me from the Registry point of view. Thanks!
If a provider changes namespace in the registry, we can detect this when running the 0.13upgrade command. As long as there is a version matching the user's constraints, we now use the provider's new source address. Otherwise, warn the user that the provider has moved and a version upgrade is necessary to move to it.
dda6345 to
fc7e467
Compare
|
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |

If a provider changes namespace in the registry, we can detect this when running the
0.13upgradecommand. As long as there is a version matching the user's constraints, we now use the provider's new source address. Otherwise, warn the user that the provider has moved and a version upgrade is necessary to move to it.Screenshots
Successful provider redirect, due to version constraint being met by the redirect target:
Cannot follow the redirect, as the version constraint cannot be met: