From 0fe621d13242b276817e4cd1fbe96414c5e7c970 Mon Sep 17 00:00:00 2001 From: Tim Gross Date: Wed, 23 Mar 2022 10:28:36 -0400 Subject: [PATCH] csi: set gRPC authority header for unix domain socket The go-grpc library used by most CSI plugins doesn't require the authority header to be set, which violates the HTTP2 spec but doesn't impact Nomad because both sides of the connection are using the same library. But plugins written in other languages (`democratic-csi` for example) may have more strictly conforming gRPC server libraries and we need to set the authority header manually. --- .changelog/12359.txt | 3 +++ plugins/csi/client.go | 1 + 2 files changed, 4 insertions(+) create mode 100644 .changelog/12359.txt diff --git a/.changelog/12359.txt b/.changelog/12359.txt new file mode 100644 index 000000000000..ff00dad7d977 --- /dev/null +++ b/.changelog/12359.txt @@ -0,0 +1,3 @@ +```release-note:bug +csi: Fixed a bug where plugins written in NodeJS could fail to fingerprint +``` diff --git a/plugins/csi/client.go b/plugins/csi/client.go index 8c5185bbefff..1a4dcf0572b2 100644 --- a/plugins/csi/client.go +++ b/plugins/csi/client.go @@ -162,6 +162,7 @@ func newGrpcConn(addr string, logger hclog.Logger) (*grpc.ClientConn, error) { grpc.WithInsecure(), grpc.WithUnaryInterceptor(logging.UnaryClientInterceptor(logger)), grpc.WithStreamInterceptor(logging.StreamClientInterceptor(logger)), + grpc.WithAuthority("localhost"), grpc.WithDialer(func(target string, timeout time.Duration) (net.Conn, error) { return net.DialTimeout("unix", target, timeout) }),