Skip to content
This repository has been archived by the owner on Apr 17, 2023. It is now read-only.

Add the Image ID in the repositories#show page #852

Merged
merged 1 commit into from
May 2, 2016

Conversation

mssola
Copy link
Collaborator

@mssola mssola commented May 2, 2016

This is the same Image ID that is shown in the docker client. In order to do
this, a new column has been added to the tags table. The registry client has
also been modified to handle all this more gracefully. The image ID being
shown is truncated in the exact same format as in the Docker client. That being
said, users can hover the mouse over the image ID and they'll get the full
image ID.

Fixes #512

Signed-off-by: Miquel Sabaté Solà [email protected]

@mssola
Copy link
Collaborator Author

mssola commented May 2, 2016

Screenshots:

busybox

registry

id, digest, = client.manifest(t.repository.name, t.name)
t.update_attributes(digest: digest, image_id: id)
rescue StandardError => e
puts "Could not get the manifest for #{repo_name}: " + e.message
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick: to be consistent, e.message should also be inside of the quote.

@monstermunchkin
Copy link
Contributor

LGTM


[id, digest]
end

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just personal taste, it can be written in that way:

def self.id_and_digest_from_event(event, repo)
  digest = event.try(:[], "target").try(:[], "digest")
  id = ""
  unless digest.blank?
    begin
      id, = Registry.get.client.manifest(repo, digest)
    rescue StandardError => e
      logger.warn "Could not fetch manifest for '#{repo}' with digest '#{digest}': " + e.message
    end
  end

  [id, digest]
end

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

@flavio
Copy link
Member

flavio commented May 2, 2016

LGTM

1 similar comment
@tboerger
Copy link
Contributor

tboerger commented May 2, 2016

LGTM

This is the same Image ID that is shown in the docker client. In order to do
this, a new column has been added to the `tags` table. The registry client has
also been modified to handle all this more gracefully. The image ID being
shown is truncated in the exact same format as in the Docker client. That
being
said, users can hover the mouse over the image ID and they'll get the full
image ID.

Fixes SUSE#512

Signed-off-by: Miquel Sabaté Solà <[email protected]>
@mssola mssola merged commit 6fa7a25 into SUSE:master May 2, 2016
@mssola mssola deleted the image-id branch May 2, 2016 13:27
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants