Skip to content
This repository has been archived by the owner on Mar 5, 2021. It is now read-only.

Commit

Permalink
Fix #2
Browse files Browse the repository at this point in the history
  • Loading branch information
clabbe committed May 26, 2016
1 parent 05121a0 commit 20dee0a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 12 deletions.
6 changes: 3 additions & 3 deletions lib/tagfish/docker_registry_v2_client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ def tags_json
api_call.get(tags_uri).json
end

def digest(tag)
api_call.get(hash_uri(tag)).digest
def hash(tag)
api_call.get(hash_uri(tag)).json
end

def tags_list
Expand All @@ -31,7 +31,7 @@ def tags_list
end

tags_with_hashes = tag_names.inject({}) do |dict, tag|
dict[tag] = digest(tag)
dict[tag] = hash(tag)["fsLayers"]
dict
end
end
Expand Down
8 changes: 0 additions & 8 deletions lib/tagfish/tags_command.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ class TagsCommand < Clamp::Command
parameter "REPOSITORY", "docker repository"
option ["-l", "--latest"], :flag, "only return latest explicitly tagged image"
option ["-s", "--short"], :flag, "only return tag, not full image path"
option ["-d", "--digest"], :flag, "returns the tag's digest (v2 API only)"

def execute

Expand All @@ -22,13 +21,6 @@ def execute
end
tags_found = latest_tags

if digest?
tags_found = tags_found.map do |tag_name|
digest = tags.tag_map[tag_name]
digest.include?("sha256:") ? tag_name + '@' + digest : tag_name
end
end

else
tags_found = docker_api.tag_names
end
Expand Down
2 changes: 1 addition & 1 deletion lib/tagfish/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module Tagfish
VERSION = "1.1.3"
VERSION = "1.1.4"
end

0 comments on commit 20dee0a

Please sign in to comment.