-
Notifications
You must be signed in to change notification settings - Fork 9.5k
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
command: Add redirect support to 0.13upgrade #26061
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is a great suggestion!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 ✅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.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.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: