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

implement programmatic default providers based on context in the engine and Go #16204

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tgummerer
Copy link
Collaborator

@tgummerer tgummerer commented May 15, 2024

This PR takes an alternative approach for implementing programmatic default providers, that was suggested in the internal design doc.

Instead of making the default provider global, we create an API with a callback that creates a new subcontext. In that subcontext and only in that subcontext is the provider set as the default provider. We achieve this by setting up a new monitor with a different port, so the engine can distinguish between the contexts.

/xref #2059
Fixes #16169
Fixes #16163

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

@pulumi-bot
Copy link
Contributor

pulumi-bot commented May 15, 2024

Changelog

[uncommitted] (2024-05-24)

Features

  • [sdk/go] Allow default providers to be set programmatically
    #16204

@tgummerer tgummerer force-pushed the tg/default-providers-take-2 branch 3 times, most recently from f34ca8e to 7f9200a Compare May 16, 2024 07:48
@tgummerer tgummerer marked this pull request as ready for review May 17, 2024 10:29
@tgummerer tgummerer requested a review from a team as a code owner May 17, 2024 10:29
proto/pulumi/resource.proto Outdated Show resolved Hide resolved
proto/pulumi/resource.proto Outdated Show resolved Hide resolved
pkg/resource/deploy/source_eval.go Outdated Show resolved Hide resolved
@tgummerer tgummerer force-pushed the tg/default-providers-take-2 branch 6 times, most recently from 4451116 to ab691c3 Compare May 23, 2024 09:02
proto/pulumi/resource.proto Outdated Show resolved Hide resolved
pkg/resource/deploy/source_eval.go Outdated Show resolved Hide resolved
pkg/resource/deploy/source_eval.go Outdated Show resolved Hide resolved
@tgummerer tgummerer force-pushed the tg/default-providers-take-2 branch from ab691c3 to 5b7821c Compare May 23, 2024 16:20
…ne and Go

This PR takes an alternative approach for implementing programmatic
default providers, that was suggested in the internal design doc.

Instead of making the default provider global, we create an API with a
callback that creates a new subcontext.  In that subcontext and only
in that subcontext is the provider set as the default provider.  We
achieve this by setting up a new monitor with a different port, so the
engine can distinguish between the contexts.
@tgummerer tgummerer force-pushed the tg/default-providers-take-2 branch 2 times, most recently from e64b47f to f20b7ac Compare May 24, 2024 14:34
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.

Go SDK support for programmatic default providers Engine support for programmatic default providers
3 participants