Skip to content

Commit

Permalink
Revert "Remove vendored plugin server" (#2438)
Browse files Browse the repository at this point in the history
Reverts #2410

---------

Co-authored-by: guineveresaenger <[email protected]>
  • Loading branch information
iwahbe and guineveresaenger authored Sep 24, 2024
1 parent 22452e6 commit b559de0
Show file tree
Hide file tree
Showing 3 changed files with 702 additions and 46 deletions.
24 changes: 24 additions & 0 deletions pf/internal/plugin/package.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// Copyright 2016-2023, Pulumi Corporation.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

// The code in this package implements Context-preserving provider server and is forked from pulumi/pulumi.
//
// We have started to make edits to customize this for pf. This includes secret handling.
//
// When https://github.com/pulumi/pulumi/issues/12010 is complete this may need to be rewritten to the newly introduced
// APIs.
//
// An attempt to upstream the Context preservation improvement in this code was rejected in
// https://github.com/pulumi/pulumi/pull/12429.
package plugin
8 changes: 1 addition & 7 deletions pf/internal/plugin/provider_context.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,9 @@ 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.GrpcProvider {
func NewProvider(p ProviderWithContext) plugin.Provider {
return &provider{ProviderWithContext: p}
}

Expand All @@ -100,10 +98,6 @@ 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 b559de0

Please sign in to comment.