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

Prefer pluginDownloadURLOverrides over PluginDownloadURL specified in the package #16186

Merged

Conversation

mikhailshilkov
Copy link
Member

@mikhailshilkov mikhailshilkov commented May 13, 2024

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 over pluginDownloadURLOverrides, 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 without PluginDownloadURL. The second one fails before my change.

Resolves #16058

Checklist

  • I have run make tidy to update any new dependencies
  • I have run make lint to verify my code passes the lint check
    • I have formatted my code using gofumpt
  • I have added tests that prove my fix is effective or that my feature works
  • I have run make changelog and committed the changelog/pending/<file> documenting my change
  • Yes, there are changes in this PR that warrants bumping the Pulumi Cloud API version

@mikhailshilkov mikhailshilkov requested a review from a team as a code owner May 13, 2024 12:31
@pulumi-bot
Copy link
Contributor

Changelog

[uncommitted] (2024-05-13)

Features

  • [sdk/go] Prefer pluginDownloadURLOverrides over PluginDownloadURL specified in the package
    #16186

@mikhailshilkov mikhailshilkov added this pull request to the merge queue May 13, 2024
Merged via the queue into master with commit 3e0aede May 13, 2024
49 checks passed
@mikhailshilkov mikhailshilkov deleted the mikhailshilkov/prefer-plugin-downloadurl-override branch May 13, 2024 15:57
@justinvp justinvp mentioned this pull request May 14, 2024
github-merge-queue bot pushed a commit that referenced this pull request May 15, 2024
### Features

- [docs] Resource docs: bump the number of displayed supporting types
from 200 to 1000 by default
  [#16185](#16185)

- [sdk/go] Prefer pluginDownloadURLOverrides over PluginDownloadURL
specified in the package
  [#16186](#16186)


### Bug Fixes

- [engine] Fix panic when using `pulumi up --refresh
--continue-on-error`
  [#16184](#16184)
github-merge-queue bot pushed a commit that referenced this pull request Jun 4, 2024
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.

Add the ability to override PluginDownloadURL if it is explicitly set on a plugin
4 participants