Merge pull request #112597 from mythi/grpc-authority

grpc: set localhost Authority to unix client calls
This commit is contained in:
Kubernetes Prow Robot 2022-10-31 03:12:45 -07:00 committed by GitHub
commit 9702161caa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 0 deletions

View File

@ -119,6 +119,7 @@ func dial(unixSocketPath string) (api.DevicePluginClient, *grpc.ClientConn, erro
defer cancel() defer cancel()
c, err := grpc.DialContext(ctx, unixSocketPath, c, err := grpc.DialContext(ctx, unixSocketPath,
grpc.WithAuthority("localhost"),
grpc.WithTransportCredentials(insecure.NewCredentials()), grpc.WithTransportCredentials(insecure.NewCredentials()),
grpc.WithBlock(), grpc.WithBlock(),
grpc.WithContextDialer(func(ctx context.Context, addr string) (net.Conn, error) { grpc.WithContextDialer(func(ctx context.Context, addr string) (net.Conn, error) {

View File

@ -535,6 +535,7 @@ func newGrpcConn(addr csiAddr, metricsManager *MetricsManager) (*grpc.ClientConn
return grpc.Dial( return grpc.Dial(
string(addr), string(addr),
grpc.WithAuthority("localhost"),
grpc.WithTransportCredentials(insecure.NewCredentials()), grpc.WithTransportCredentials(insecure.NewCredentials()),
grpc.WithContextDialer(func(ctx context.Context, target string) (net.Conn, error) { grpc.WithContextDialer(func(ctx context.Context, target string) (net.Conn, error) {
return (&net.Dialer{}).DialContext(ctx, network, target) return (&net.Dialer{}).DialContext(ctx, network, target)