summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAhmad Sherif <me@ahmadsherif.com>2017-04-03 15:27:14 +0200
committerAhmad Sherif <me@ahmadsherif.com>2017-04-03 18:45:36 +0200
commit09751c75ebaee03f5161c4e86f16a18a8f5b050f (patch)
tree59c3f9fe787f52b5e88293f649a7f89c4223d71c /lib
parent2fceb4374141407b2f41ed7b6af5a0b6a2f9f4f1 (diff)
downloadgitlab-ce-09751c75ebaee03f5161c4e86f16a18a8f5b050f.tar.gz
Add support for Gitaly calls over TCP connectionfeature/support-grpc-calls-over-tcp-conn
Closes gitaly#166
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/gitaly_client.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/gitlab/gitaly_client.rb b/lib/gitlab/gitaly_client.rb
index a0dbe0a8c11..fe15fb12adb 100644
--- a/lib/gitlab/gitaly_client.rb
+++ b/lib/gitlab/gitaly_client.rb
@@ -12,9 +12,11 @@ module Gitlab
end
def self.new_channel(address)
- # NOTE: Gitaly currently runs on a Unix socket, so permissions are
+ address = address.sub(%r{^tcp://}, '') if URI(address).scheme == 'tcp'
+ # NOTE: When Gitaly runs on a Unix socket, permissions are
# handled using the file system and no additional authentication is
# required (therefore the :this_channel_is_insecure flag)
+ # TODO: Add authentication support when Gitaly is running on a TCP socket.
GRPC::Core::Channel.new(address, {}, :this_channel_is_insecure)
end