summaryrefslogtreecommitdiff
path: root/lib/container_registry
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2018-03-16 19:05:29 +0800
committerLin Jen-Shin <godfat@godfat.org>2018-03-16 19:05:29 +0800
commit31b0097be06fcbb1f1586fbf868ecb9c4bcfb1b0 (patch)
tree7e85e471c48d415c4db01e0f58b98d38c058de33 /lib/container_registry
parenta63d74709be2af852e3c98505a18664e6bca9754 (diff)
downloadgitlab-ce-31b0097be06fcbb1f1586fbf868ecb9c4bcfb1b0.tar.gz
Setup Faraday middleware before adapter
This eliminate the warnings: WARNING: Unexpected middleware set after the adapter. This won't be supported from Faraday 1.0.
Diffstat (limited to 'lib/container_registry')
-rw-r--r--lib/container_registry/client.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/container_registry/client.rb b/lib/container_registry/client.rb
index c7263f302ab..010ca1ec27b 100644
--- a/lib/container_registry/client.rb
+++ b/lib/container_registry/client.rb
@@ -52,6 +52,8 @@ module ContainerRegistry
conn.request(:authorization, :bearer, options[:token].to_s)
end
+ yield(conn) if block_given?
+
conn.adapter :net_http
end
@@ -80,8 +82,7 @@ module ContainerRegistry
def faraday
@faraday ||= Faraday.new(@base_uri) do |conn|
- initialize_connection(conn, @options)
- accept_manifest(conn)
+ initialize_connection(conn, @options, &method(:accept_manifest))
end
end