diff --git a/pkg/engine/lifecycletest/pulumi_test.go b/pkg/engine/lifecycletest/pulumi_test.go index c17b85a38ccd..17e02d3722bb 100644 --- a/pkg/engine/lifecycletest/pulumi_test.go +++ b/pkg/engine/lifecycletest/pulumi_test.go @@ -33,6 +33,7 @@ import ( "github.com/stretchr/testify/require" "google.golang.org/grpc" "google.golang.org/grpc/codes" + "google.golang.org/grpc/credentials/insecure" "github.com/pulumi/pulumi/pkg/v3/engine" . "github.com/pulumi/pulumi/pkg/v3/engine" @@ -2944,7 +2945,7 @@ func (ctx *updateContext) Run(_ context.Context, req *pulumirpc.RunRequest) (*pu // Connect to the resource monitor and create an appropriate client. conn, err := grpc.Dial( req.MonitorAddress, - grpc.WithInsecure(), + grpc.WithTransportCredentials(insecure.NewCredentials()), rpcutil.GrpcChannelOptions(), ) if err != nil { diff --git a/pkg/engine/plugin_host.go b/pkg/engine/plugin_host.go index 6041b01368b8..50deb12d50af 100644 --- a/pkg/engine/plugin_host.go +++ b/pkg/engine/plugin_host.go @@ -18,6 +18,7 @@ import ( "fmt" "google.golang.org/grpc" + "google.golang.org/grpc/credentials/insecure" "github.com/pulumi/pulumi/sdk/v3/go/common/resource/plugin" "github.com/pulumi/pulumi/sdk/v3/go/common/util/rpcutil" @@ -52,7 +53,7 @@ func (host *clientLanguageRuntimeHost) LanguageRuntime( func langRuntimePluginDialOptions(ctx *plugin.Context, address string) []grpc.DialOption { dialOpts := append( rpcutil.OpenTracingInterceptorDialOptions(), - grpc.WithInsecure(), + grpc.WithTransportCredentials(insecure.NewCredentials()), rpcutil.GrpcChannelOptions(), ) diff --git a/pkg/resource/deploy/deploytest/pluginhost.go b/pkg/resource/deploy/deploytest/pluginhost.go index 93c73cffa0c5..e4e0eaf8595f 100644 --- a/pkg/resource/deploy/deploytest/pluginhost.go +++ b/pkg/resource/deploy/deploytest/pluginhost.go @@ -26,6 +26,7 @@ import ( pbempty "github.com/golang/protobuf/ptypes/empty" "google.golang.org/grpc" + "google.golang.org/grpc/credentials/insecure" "github.com/pulumi/pulumi/sdk/v3/go/common/diag" "github.com/pulumi/pulumi/sdk/v3/go/common/resource" @@ -169,7 +170,7 @@ func wrapProviderWithGrpc(provider plugin.Provider) (plugin.Provider, io.Closer, } conn, err := grpc.Dial( fmt.Sprintf("127.0.0.1:%v", handle.Port), - grpc.WithInsecure(), + grpc.WithTransportCredentials(insecure.NewCredentials()), grpc.WithUnaryInterceptor(rpcutil.OpenTracingClientInterceptor()), grpc.WithStreamInterceptor(rpcutil.OpenTracingStreamClientInterceptor()), rpcutil.GrpcChannelOptions(), diff --git a/pkg/resource/deploy/deploytest/resourcemonitor.go b/pkg/resource/deploy/deploytest/resourcemonitor.go index 4434083e2933..ebaa2c6653c6 100644 --- a/pkg/resource/deploy/deploytest/resourcemonitor.go +++ b/pkg/resource/deploy/deploytest/resourcemonitor.go @@ -25,6 +25,7 @@ import ( "github.com/pulumi/pulumi/sdk/v3/go/common/util/rpcutil" pulumirpc "github.com/pulumi/pulumi/sdk/v3/proto/go" "google.golang.org/grpc" + "google.golang.org/grpc/credentials/insecure" ) type ResourceMonitor struct { @@ -39,7 +40,7 @@ func dialMonitor(ctx context.Context, endpoint string) (*ResourceMonitor, error) // Connect to the resource monitor and create an appropriate client. conn, err := grpc.Dial( endpoint, - grpc.WithInsecure(), + grpc.WithTransportCredentials(insecure.NewCredentials()), rpcutil.GrpcChannelOptions(), ) if err != nil { diff --git a/pkg/resource/provider/host.go b/pkg/resource/provider/host.go index 6bd5299625ad..b139a6e6dec6 100644 --- a/pkg/resource/provider/host.go +++ b/pkg/resource/provider/host.go @@ -26,6 +26,7 @@ import ( lumirpc "github.com/pulumi/pulumi/sdk/v3/proto/go" "golang.org/x/net/context" "google.golang.org/grpc" + "google.golang.org/grpc/credentials/insecure" "google.golang.org/grpc/grpclog" ) @@ -42,7 +43,7 @@ func NewHostClient(addr string) (*HostClient, error) { grpclog.SetLoggerV2(grpclog.NewLoggerV2(io.Discard, io.Discard, os.Stderr)) conn, err := grpc.Dial( addr, - grpc.WithInsecure(), + grpc.WithTransportCredentials(insecure.NewCredentials()), grpc.WithUnaryInterceptor(rpcutil.OpenTracingClientInterceptor()), grpc.WithStreamInterceptor(rpcutil.OpenTracingStreamClientInterceptor()), rpcutil.GrpcChannelOptions(), diff --git a/sdk/go/common/resource/plugin/analyzer_plugin.go b/sdk/go/common/resource/plugin/analyzer_plugin.go index ac9899bc03ae..67a63df89ded 100644 --- a/sdk/go/common/resource/plugin/analyzer_plugin.go +++ b/sdk/go/common/resource/plugin/analyzer_plugin.go @@ -29,6 +29,7 @@ import ( "github.com/pkg/errors" "google.golang.org/grpc" "google.golang.org/grpc/codes" + "google.golang.org/grpc/credentials/insecure" "github.com/pulumi/pulumi/sdk/v3/go/common/apitype" "github.com/pulumi/pulumi/sdk/v3/go/common/resource" @@ -422,7 +423,7 @@ func (a *analyzer) Close() error { func analyzerPluginDialOptions(ctx *Context, name string) []grpc.DialOption { dialOpts := append( rpcutil.OpenTracingInterceptorDialOptions(), - grpc.WithInsecure(), + grpc.WithTransportCredentials(insecure.NewCredentials()), rpcutil.GrpcChannelOptions(), ) diff --git a/sdk/go/common/resource/plugin/langruntime_plugin.go b/sdk/go/common/resource/plugin/langruntime_plugin.go index efd0a10e532b..73e5d7391cc4 100644 --- a/sdk/go/common/resource/plugin/langruntime_plugin.go +++ b/sdk/go/common/resource/plugin/langruntime_plugin.go @@ -27,6 +27,7 @@ import ( "github.com/pkg/errors" "google.golang.org/grpc" "google.golang.org/grpc/codes" + "google.golang.org/grpc/credentials/insecure" "github.com/pulumi/pulumi/sdk/v3/go/common/diag/colors" "github.com/pulumi/pulumi/sdk/v3/go/common/tokens" @@ -83,7 +84,7 @@ func NewLanguageRuntime(host Host, ctx *Context, root, pwd, runtime string, func langRuntimePluginDialOptions(ctx *Context, runtime string) []grpc.DialOption { dialOpts := append( rpcutil.OpenTracingInterceptorDialOptions(), - grpc.WithInsecure(), + grpc.WithTransportCredentials(insecure.NewCredentials()), rpcutil.GrpcChannelOptions(), ) diff --git a/sdk/go/common/resource/plugin/provider_plugin.go b/sdk/go/common/resource/plugin/provider_plugin.go index fa51e2e40d24..3a7267b563d6 100644 --- a/sdk/go/common/resource/plugin/provider_plugin.go +++ b/sdk/go/common/resource/plugin/provider_plugin.go @@ -32,6 +32,7 @@ import ( "github.com/pkg/errors" "google.golang.org/grpc" "google.golang.org/grpc/codes" + "google.golang.org/grpc/credentials/insecure" "github.com/pulumi/pulumi/sdk/v3/go/common/resource" "github.com/pulumi/pulumi/sdk/v3/go/common/tokens" @@ -166,7 +167,7 @@ func NewProvider(host Host, ctx *Context, pkg tokens.Package, version *semver.Ve func providerPluginDialOptions(ctx *Context, pkg tokens.Package, path string) []grpc.DialOption { dialOpts := append( rpcutil.OpenTracingInterceptorDialOptions(otgrpc.SpanDecorator(decorateProviderSpans)), - grpc.WithInsecure(), + grpc.WithTransportCredentials(insecure.NewCredentials()), rpcutil.GrpcChannelOptions(), ) diff --git a/sdk/go/common/util/rpcutil/health.go b/sdk/go/common/util/rpcutil/health.go index 7fc7bc29b68c..0abb10a133c8 100644 --- a/sdk/go/common/util/rpcutil/health.go +++ b/sdk/go/common/util/rpcutil/health.go @@ -20,6 +20,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" + "google.golang.org/grpc/credentials/insecure" healthpb "google.golang.org/grpc/health/grpc_health_v1" "google.golang.org/grpc/status" ) @@ -28,7 +29,7 @@ import ( func Healthcheck(context context.Context, addr string, duration time.Duration, cancel context.CancelFunc) error { conn, err := grpc.Dial( addr, - grpc.WithInsecure(), + grpc.WithTransportCredentials(insecure.NewCredentials()), grpc.WithUnaryInterceptor(OpenTracingClientInterceptor()), grpc.WithStreamInterceptor(OpenTracingStreamClientInterceptor()), GrpcChannelOptions(), diff --git a/sdk/go/pulumi/context.go b/sdk/go/pulumi/context.go index 05245cf9722c..5bcfccfe7827 100644 --- a/sdk/go/pulumi/context.go +++ b/sdk/go/pulumi/context.go @@ -36,6 +36,7 @@ import ( "github.com/pulumi/pulumi/sdk/v3/go/common/util/rpcutil" pulumirpc "github.com/pulumi/pulumi/sdk/v3/proto/go" "google.golang.org/grpc" + "google.golang.org/grpc/credentials/insecure" ) var disableResourceReferences = cmdutil.IsTruthy(os.Getenv("PULUMI_DISABLE_RESOURCE_REFERENCES")) @@ -73,7 +74,7 @@ func NewContext(ctx context.Context, info RunInfo) (*Context, error) { if addr := info.MonitorAddr; addr != "" { conn, err := grpc.Dial( info.MonitorAddr, - grpc.WithInsecure(), + grpc.WithTransportCredentials(insecure.NewCredentials()), rpcutil.GrpcChannelOptions(), ) if err != nil { @@ -91,7 +92,7 @@ func NewContext(ctx context.Context, info RunInfo) (*Context, error) { } else if addr := info.EngineAddr; addr != "" { conn, err := grpc.Dial( info.EngineAddr, - grpc.WithInsecure(), + grpc.WithTransportCredentials(insecure.NewCredentials()), rpcutil.GrpcChannelOptions(), ) if err != nil { diff --git a/sdk/nodejs/cmd/pulumi-language-nodejs/main.go b/sdk/nodejs/cmd/pulumi-language-nodejs/main.go index 95bdb7827452..e0b980661f77 100644 --- a/sdk/nodejs/cmd/pulumi-language-nodejs/main.go +++ b/sdk/nodejs/cmd/pulumi-language-nodejs/main.go @@ -45,6 +45,7 @@ import ( "github.com/hashicorp/go-multierror" opentracing "github.com/opentracing/opentracing-go" "google.golang.org/grpc" + "google.golang.org/grpc/credentials/insecure" "github.com/pulumi/pulumi/sdk/v3/go/common/resource/config" "github.com/pulumi/pulumi/sdk/v3/go/common/resource/plugin" @@ -444,7 +445,7 @@ func (host *nodeLanguageHost) Run(ctx context.Context, req *pulumirpc.RunRequest // Make a connection to the real monitor that we will forward messages to. conn, err := grpc.Dial( req.GetMonitorAddress(), - grpc.WithInsecure(), + grpc.WithTransportCredentials(insecure.NewCredentials()), rpcutil.GrpcChannelOptions(), ) if err != nil { diff --git a/sdk/python/cmd/pulumi-language-python/main.go b/sdk/python/cmd/pulumi-language-python/main.go index ae5949c37b77..6ec0a9d1f0fc 100644 --- a/sdk/python/cmd/pulumi-language-python/main.go +++ b/sdk/python/cmd/pulumi-language-python/main.go @@ -51,6 +51,7 @@ import ( pulumirpc "github.com/pulumi/pulumi/sdk/v3/proto/go" "github.com/pulumi/pulumi/sdk/v3/python" "google.golang.org/grpc" + "google.golang.org/grpc/credentials/insecure" ) const ( @@ -282,7 +283,7 @@ func (host *pythonLanguageHost) prepareVirtualEnvironment(ctx context.Context, c // Make a connection to the real engine that we will log messages to. conn, err := grpc.Dial( host.engineAddress, - grpc.WithInsecure(), + grpc.WithTransportCredentials(insecure.NewCredentials()), rpcutil.GrpcChannelOptions(), ) if err != nil { diff --git a/tests/integration/integration_util_test.go b/tests/integration/integration_util_test.go index e06440d85233..4c9710b2ed18 100644 --- a/tests/integration/integration_util_test.go +++ b/tests/integration/integration_util_test.go @@ -42,6 +42,7 @@ import ( pulumirpc "github.com/pulumi/pulumi/sdk/v3/proto/go" "github.com/stretchr/testify/assert" "google.golang.org/grpc" + "google.golang.org/grpc/credentials/insecure" ) const WindowsOS = "windows" @@ -133,7 +134,11 @@ func testComponentProviderSchema(t *testing.T, path string) { port := strings.TrimSpace(string(bytes)) // Create a connection to the server. - conn, err := grpc.Dial("127.0.0.1:"+port, grpc.WithInsecure(), rpcutil.GrpcChannelOptions()) + conn, err := grpc.Dial( + "127.0.0.1:"+port, + grpc.WithTransportCredentials(insecure.NewCredentials()), + rpcutil.GrpcChannelOptions(), + ) assert.NoError(t, err) client := pulumirpc.NewResourceProviderClient(conn)