This repository has been archived by the owner on Apr 17, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 472
Add the Image ID in the repositories#show page #852
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
There was a problem hiding this comment.
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.
LGTM |
|
||
[id, digest] | ||
end | ||
|
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
LGTM |
1 similar comment
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]>
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 hasalso 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]