Commit 35319aa4 authored by Kamil Trzciński's avatar Kamil Trzciński 🔴

Use response_body

parent 04ffd71e
...@@ -15,13 +15,11 @@ module ContainerRegistry ...@@ -15,13 +15,11 @@ module ContainerRegistry
end end
def repository_tags(name) def repository_tags(name)
response = @faraday.get("/v2/#{name}/tags/list") response_body @faraday.get("/v2/#{name}/tags/list")
response.body if response.success?
end end
def repository_manifest(name, reference) def repository_manifest(name, reference)
response = @faraday.get("/v2/#{name}/manifests/#{reference}") response_body @faraday.get("/v2/#{name}/manifests/#{reference}")
response.body if response.success?
end end
def repository_tag_digest(name, reference) def repository_tag_digest(name, reference)
...@@ -36,8 +34,7 @@ module ContainerRegistry ...@@ -36,8 +34,7 @@ module ContainerRegistry
def blob(name, digest, type = nil) def blob(name, digest, type = nil)
headers = {} headers = {}
headers['Accept'] = type if type headers['Accept'] = type if type
response = @faraday.get("/v2/#{name}/blobs/#{digest}", nil, headers) response_body @faraday.get("/v2/#{name}/blobs/#{digest}", nil, headers)
response.body if response.success?
end end
def delete_blob(name, digest) def delete_blob(name, digest)
...@@ -63,5 +60,9 @@ module ContainerRegistry ...@@ -63,5 +60,9 @@ module ContainerRegistry
conn.adapter :net_http conn.adapter :net_http
end end
def response_body(response)
response.body if response.success?
end
end end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment