Skip to content

Commit b559de0

Browse files
Revert "Remove vendored plugin server" (#2438)
Reverts #2410 --------- Co-authored-by: guineveresaenger <[email protected]>
1 parent 22452e6 commit b559de0

File tree

3 files changed

+702
-46
lines changed

3 files changed

+702
-46
lines changed

pf/internal/plugin/package.go

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// Copyright 2016-2023, Pulumi Corporation.
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
// The code in this package implements Context-preserving provider server and is forked from pulumi/pulumi.
16+
//
17+
// We have started to make edits to customize this for pf. This includes secret handling.
18+
//
19+
// When https://github.com/pulumi/pulumi/issues/12010 is complete this may need to be rewritten to the newly introduced
20+
// APIs.
21+
//
22+
// An attempt to upstream the Context preservation improvement in this code was rejected in
23+
// https://github.com/pulumi/pulumi/pull/12429.
24+
package plugin

pf/internal/plugin/provider_context.go

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,9 @@ type ProviderWithContext interface {
8585
GetMappingsWithContext(ctx context.Context, key string) ([]string, error)
8686

8787
ParameterizeWithContext(context.Context, plugin.ParameterizeRequest) (plugin.ParameterizeResponse, error)
88-
89-
Attach(address string) error
9088
}
9189

92-
func NewProvider(p ProviderWithContext) plugin.GrpcProvider {
90+
func NewProvider(p ProviderWithContext) plugin.Provider {
9391
return &provider{ProviderWithContext: p}
9492
}
9593

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

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

103-
func (prov *provider) Attach(address string) error {
104-
return prov.ProviderWithContext.Attach(address)
105-
}
106-
107101
func (prov *provider) Pkg() tokens.Package { return prov.ProviderWithContext.Pkg() }
108102

109103
func (prov *provider) Parameterize(

0 commit comments

Comments
 (0)