Skip to content

Commit

Permalink
Remove vendored plugin server
Browse files Browse the repository at this point in the history
As part of #2148, this PR removes the duplicate implementation of
`pulumigrpc.ResourceProviderServer` copied over from pulumi/pulumi and then modified.

This is a post #2258 version of #2195, and is much less invasive.

Addressing previous edits in response to
#2195 (comment):

- #1716: This change accommodated for a previous edit (`ProviderWithContext`) and is no
  longer necessary. That said, the tests it introduced are still present (and continue to
  pass), so we are sure this commit did not break the functionality.
- #1683: Simply brings DiffConfig into line with pu/pu, which we get for free by not
  vendoring.
- #1047: This is still handled in `provider_server.go`, and is still under test.
- #1065: This has already been moved out of this area in #2258, so it is no longer
  relevant here.
  • Loading branch information
iwahbe committed Sep 11, 2024
1 parent 7864bb0 commit fbc2abd
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 702 deletions.
24 changes: 0 additions & 24 deletions pf/internal/plugin/package.go

This file was deleted.

8 changes: 7 additions & 1 deletion pf/internal/plugin/provider_context.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,11 @@ type ProviderWithContext interface {
GetMappingsWithContext(ctx context.Context, key string) ([]string, error)

ParameterizeWithContext(context.Context, plugin.ParameterizeRequest) (plugin.ParameterizeResponse, error)

Attach(address string) error
}

func NewProvider(p ProviderWithContext) plugin.Provider {
func NewProvider(p ProviderWithContext) plugin.GrpcProvider {
return &provider{ProviderWithContext: p}
}

Expand All @@ -98,6 +100,10 @@ type provider struct {

var _ plugin.Provider = (*provider)(nil)

func (prov *provider) Attach(address string) error {
return prov.ProviderWithContext.Attach(address)
}

func (prov *provider) Pkg() tokens.Package { return prov.ProviderWithContext.Pkg() }

func (prov *provider) Parameterize(
Expand Down
Loading

0 comments on commit fbc2abd

Please sign in to comment.