-
Notifications
You must be signed in to change notification settings - Fork 900
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
identify openshift images through command variable #15022
identify openshift images through command variable #15022
Conversation
cc @moolitayer |
@enoodle Cannot apply the following label because they are not recognized: providers/containers enhancement |
app/models/container_image.rb
Outdated
@@ -112,5 +112,9 @@ def disconnect_inv | |||
save | |||
end | |||
|
|||
def openshift_image? | |||
command.present? |
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 why command
being present would give an indication whether it's an openshift_image
or not?
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.
We are only collecting this field from Openshift images and I expect all of them to have it. In case not all images have command
and we can't find another field that answers these criteria then we will need to add something to mark it.
BTW this is currently will cause an error message when ManageIQ attempts to annotate an image that doesn't exists but this won't result in a negative user experience so maybe we also want to leave it as is.
@enoodle I think the idea is good but the current implementation is poor. Maybe we should do something at refresh time (e.g. use a |
We will need to avoid some confusion. We have
we usually use Inheritance for 1. vs the others, this case we would need distinguish between 2 and others. |
@moolitayer what's the difference between these two? |
For this pr they are the same. I would expect 1 and 2 to be represented by |
@moolitayer with reference to your comment, I don't think there's any difference between 1 and 3, they are both ContainerImage (there's nothing specific of OpenShift). |
@simon3z @moolitayer bump |
@enoodle as mentioned in the past I would like to see this at refresh-time. Feel free to update this PR or close it to handle the issue in another one. |
ea270fc
to
5e459f9
Compare
@moolitayer @simon3z I have added |
a3fa362
to
483d79b
Compare
@enoodle we need a unique identifier for the image but again I think we need also two different types for the images. |
483d79b
to
bf63edc
Compare
Will allow to identify provider entities of images from images that are entities only in ManageIQ
bf63edc
to
934d7ce
Compare
Checked commit enoodle@934d7ce with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0 app/models/miq_action.rb
spec/models/miq_action_spec.rb
|
@@ -742,7 +742,7 @@ def action_container_image_annotate_deny_execution(action, rec, inputs) | |||
return | |||
end | |||
|
|||
unless rec.digest.present? | |||
unless !rec.ems_ref.blank? |
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.
unless + ! + blank? is a recipe for confusion... This is equivalent to if rec.ems_ref.blank?
@simon3z I'll wait on your before I review further. I think my opinion matches yours in #15022 (comment) |
Different classes for container images: #15386 |
This pull request is not mergeable. Please rebase and repush. |
Database migrations have now been moved to the https://github.com/ManageIQ/manageiq-schema repo. Please see http://talk.manageiq.org/t/new-split-repo-manageiq-schema/2478 for instructions on how to transfer your database migrations. If this PR contains only migrations, I will leave it open for a short time during the transition, after which I will close this if it has not been moved over. |
Factor out Openshift image identification and use the
command
attribute as we are also parsing digest for images originating only from pods.