Prefer pluginDownloadURLOverrides over PluginDownloadURL specified in the package #16186
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Overriding plugin download URLs with compilation flags was originally added in #8798. Its intent was allowing our customers to override download locations for all plugins, so that only trusted pre-approved plugins could be downloaded.
Since then, we've added
PluginDownloadURL
for a package, which is the default URL for that package's binary if it's shipped outside our Pulumi org. Currently,PluginDownloadURL
takes precedence overpluginDownloadURLOverrides
, which means it's impossible to override third-party package binary locations.This PR changes plugin source resolution to flip the priority of those two. If an override matches regex, its URL will take priority over the default
PluginDownloadURL
specified in the package.I have added tests to verify
pluginDownloadURLOverrides
with and withoutPluginDownloadURL
. The second one fails before my change.Resolves #16058
Checklist
make tidy
to update any new dependenciesmake lint
to verify my code passes the lint checkgofumpt
make changelog
and committed thechangelog/pending/<file>
documenting my change