summaryrefslogtreecommitdiff
path: root/lib/container_registry
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2016-06-17 17:33:03 +0200
committerKamil Trzcinski <ayufan@ayufan.eu>2016-06-17 17:33:03 +0200
commit35319aa4ac0d33b5722bbced38767735d045971d (patch)
treec123001073236d776cb28c3cfd6c78a77817de8a /lib/container_registry
parent04ffd71e53efd38b510eaccf96cbd3ccb51293f6 (diff)
downloadgitlab-ce-35319aa4ac0d33b5722bbced38767735d045971d.tar.gz
Use response_body
Diffstat (limited to 'lib/container_registry')
-rw-r--r--lib/container_registry/client.rb13
1 files changed, 7 insertions, 6 deletions
diff --git a/lib/container_registry/client.rb b/lib/container_registry/client.rb
index b222be0475e..42232b7129d 100644
--- a/lib/container_registry/client.rb
+++ b/lib/container_registry/client.rb
@@ -15,13 +15,11 @@ module ContainerRegistry
end
def repository_tags(name)
- response = @faraday.get("/v2/#{name}/tags/list")
- response.body if response.success?
+ response_body @faraday.get("/v2/#{name}/tags/list")
end
def repository_manifest(name, reference)
- response = @faraday.get("/v2/#{name}/manifests/#{reference}")
- response.body if response.success?
+ response_body @faraday.get("/v2/#{name}/manifests/#{reference}")
end
def repository_tag_digest(name, reference)
@@ -36,8 +34,7 @@ module ContainerRegistry
def blob(name, digest, type = nil)
headers = {}
headers['Accept'] = type if type
- response = @faraday.get("/v2/#{name}/blobs/#{digest}", nil, headers)
- response.body if response.success?
+ response_body @faraday.get("/v2/#{name}/blobs/#{digest}", nil, headers)
end
def delete_blob(name, digest)
@@ -63,5 +60,9 @@ module ContainerRegistry
conn.adapter :net_http
end
+
+ def response_body(response)
+ response.body if response.success?
+ end
end
end