-
Notifications
You must be signed in to change notification settings - Fork 899
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
handling docker-pullable image ids #12711
handling docker-pullable image ids #12711
Conversation
@zeari can you review? (Probably you already reviewed part/all of it in the other PR but I want to make sure) |
cc @moolitayer (review if you have time) |
@miq-bot add_label providers/containers, bug |
(?:(?: | ||
(?<host>([^\.:/]+\.)+[^\.:/]+)| | ||
(?:(?<host2>[^:/]+)(?::(?<port>\d+)))| | ||
(?<localhost>localhost) | ||
)/)? | ||
(?<name>(?:[^:/@]+/)*[^/:@]+) | ||
(?:(?::(?<tag>.+))|(?:\@(?<digest>.+)))? | ||
(?::(?<tag>[^:/@]+))? | ||
(?:\@(?<digest>.+))? |
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.
Can we have both a tag and a digest? (asking about the change from | to both parts being optional)
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.
Yes, Now we can have them both, but before is was one or the other (The tag would have included the digest..)
:digest => parts[:digest], | ||
:name => image_parts[:name], | ||
:tag => image_parts[:tag], | ||
:digest => image_parts[:digest] || image_ref_parts[:digest], |
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.
can you give an example of an image ref with a digest?
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.
docker-pullable://registry.access.redhat.com/openshift3/metrics-deployer@sha256:45f2f81608edcdf53f8f94b4893fc33c824a5ca79d467191e5db1a267f46bb3a
It seems that the new docker added the registry and name to the imageID field too after the docker-pullable://
prefix.
9e49471
to
d9a1611
Compare
d9a1611
to
ef2ca66
Compare
@enoodle can you try to find reviews and LGTM for this? Thanks. |
:image => {:name => "name1", :tag => "tagos", :digest => "sha256:123abcdef", | ||
:image_ref => example_ref}, | ||
:registry => {:name => "reg.example.com", :host => "reg.example.com", :port => "1234"}}, | ||
|
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.
Can you add a test for the new definitions?
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.
@moolitayer I added this test below:
ef2ca66
to
d8cd039
Compare
@moolitayer I added more tests |
Thanks @enoodle ✨ |
LGTM 👍 @miq-bot assign chessbyte |
@simon3z Yes, backport to euwe |
end | ||
|
||
"cannot analyze image %s with id %s: detected id was %s" % [ | ||
options[:image_full_name], options[:docker_image_id][0..11], actual[0..11]] |
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.
@enoodle don't you have to update this being more specific now? (Maybe the check that failed was about the RepoDigests
) No need for anything fancy... I just feel that this message now is misleading.
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.
@simon3z We wouldn't know which one "should" have not failed as all the checks have already failed. I could also add the detected RepoDigests
Some thing like this:
msg = "cannot analyze image %s with id %s: detected ids were %s" % [
options[:image_full_name], options[:docker_image_id][0..11], actual[0..11]]
metadata.RepoDigests.each do |digest|
msg << digest.split('@').last[0..11] + ", "
end
return msg
I am splitting on '@' because RepoDigests include the image-repository and name but this will be less interesting in this message in my opinion.
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.
@simon3z I made this change, PTAL at the code.
958471d
to
6906640
Compare
6906640
to
0ab53d9
Compare
<github_pr_commenter_batch />Some comments on commits enoodle/manageiq@eebf813~...0ab53d9 spec/models/manageiq/providers/kubernetes/container_manager/scanning/job_spec.rb
|
Checked commits enoodle/manageiq@eebf813~...0ab53d9 with ruby 2.2.5, rubocop 0.37.2, and haml-lint 0.16.1 app/models/manageiq/providers/kubernetes/container_manager/scanning/job.rb
spec/models/manageiq/providers/kubernetes/container_manager/scanning/job_spec.rb
|
@moolitayer @zeari PTAL |
LGTM |
ping @simon3z @chessbyte |
Ready for merge 👍 @miq-bot assign chessbyte |
cc @roliveri |
…es_ids handling docker-pullable image ids (cherry picked from commit 4a52be9) https://bugzilla.redhat.com/show_bug.cgi?id=1348610 https://bugzilla.redhat.com/show_bug.cgi?id=1400615
Euwe Backport details: $ git log -1
commit 8c861a6fd622c29fbeca3cfd5bdfddd4e8fb9abd
Author: Richard Oliveri <oliveri.richard.github@gmail.com>
Date: Thu Dec 1 12:44:58 2016 -0500
Merge pull request #12711 from enoodle/docker_pullable_container_images_ids
handling docker-pullable image ids
(cherry picked from commit 4a52be99ceb25b66099b6dfce9200963ec978d30)
https://bugzilla.redhat.com/show_bug.cgi?id=1348610
https://bugzilla.redhat.com/show_bug.cgi?id=1400615 |
Backported to Darga via #13142 |
Recently Kubernetes / Docker started having a different prefix to the docker imageID:
docker-pullable
. This PR handles the changes needed to handle this change to save the image digest, name and docker_id and use them in a similar way to what was intended before.BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1395632
BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1400615