Skip to content

Commit

Permalink
csi: set gRPC authority header for unix domain socket
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
tgross committed Mar 23, 2022
1 parent 876e816 commit e7a3f99
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions plugins/csi/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}),
Expand Down

0 comments on commit e7a3f99

Please sign in to comment.