Skip to content
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

read image acquiring status #174

Merged
merged 1 commit into from
Nov 30, 2017

Conversation

enoodle
Copy link

@enoodle enoodle commented Nov 22, 2017

Meant to report that image-inspector failed to acquire the image, this will read ImageAcquireSuccess, ImageAcquireError and abort the job if needed with the error reported from image-inspector.

Based on image-inspector change from: openshift/image-inspector#82

Currently (Before these two fixes) when Image-Inspector is failing to acquire the image it will exit and the Job on the ManageIQ side will wait until timeout is reached for the information to be served.

When the image-inspector image is updated with this change but ManageIQ is running without this patch the error message will look similar to this:

cannot analyze image 172.30.6.216:5000/test2/origin-ruby-sample@sha256:050b667cd1c1d5c5781f0c8ee5763ab5ef26e3a15c4d85cf7d143c1513890cec with id 172.30.6.216: detected ids were 

But this patch will change it to:

image acquiring error: Unable to pull docker image: <nil>

BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1491643
BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1484936

@enoodle enoodle force-pushed the read_ssa_image_acquiring_status branch from 0cf4f3c to 37847a5 Compare November 22, 2017 10:17
@enoodle enoodle force-pushed the read_ssa_image_acquiring_status branch from 37847a5 to b135d68 Compare November 22, 2017 11:13
@miq-bot
Copy link
Member

miq-bot commented Nov 22, 2017

Some comments on commit enoodle@b135d68

spec/models/manageiq/providers/kubernetes/container_manager/scanning/job_spec.rb

  • ⚠️ - 413 - Detected allow_any_instance_of. This RSpec method is highly discouraged, please only use when absolutely necessary.

@miq-bot
Copy link
Member

miq-bot commented Nov 22, 2017

Checked commit enoodle@b135d68 with ruby 2.3.3, rubocop 0.47.1, haml-lint 0.20.0, and yamllint 1.10.0
2 files checked, 0 offenses detected
Everything looks fine. 🍰

@enoodle
Copy link
Author

enoodle commented Nov 29, 2017

@ilackarms @cben @yaacov Can you review please?

@moolitayer
Copy link

When the image-inspector image is updated with this change but ManageIQ is running without this patch the error message will look similar to this:

What happens when we have the patch here but old image inspector? can you add a test that makes sure we do not crash in that scenario

@enoodle
Copy link
Author

enoodle commented Nov 29, 2017

What happens when we have the patch here but old image inspector? can you add a test that makes sure we do not crash in that scenario

Nothing, Image-Inspector will exit with error and the Job will wait until this Jobs receives timeout and deletes it. The same timeout tests for Jobs apply here.

@moolitayer
Copy link

A thought, we have this check in several places:

return queue_signal(:abort_job, "no image found", "error") unless image

I think we should test if the image was archived. we would still need what you did here but would be able to report sooner before communicating with image-inspector in some cases.

BTW since there is work done on pod watch we should know fast when an image originating from a pod was deleted

@enoodle
Copy link
Author

enoodle commented Nov 29, 2017

@moolitayer We should do this on another PR, this one is only for reading status from Image-Inspector.

Copy link
Member

@yaacov yaacov left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@yaacov
Copy link
Member

yaacov commented Nov 29, 2017

note: the LGTM above pending openshift/image-inspector#82 :-)

@ilackarms
Copy link

looks good 👍

@moolitayer
Copy link

@moolitayer We should do this on another PR, this one is only for reading status from Image-Inspector.

I'm fine with that, my comment is regarding the bzs mentioned here

Copy link

@moolitayer moolitayer left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@moolitayer
Copy link

moolitayer commented Nov 30, 2017

@enoodle just making sure again, you are saying we can merge here before the image-inspector change right?
Also I think it's worth doing a PR for not going to image inspector if the image is archived, WDYT?
(changing the image existence check for post image archive)

@enoodle
Copy link
Author

enoodle commented Nov 30, 2017

@moolitayer

just making sure again, you are saying we can merge here before the image-inspector change right?

Yes, With the happy flow inspector_metadata.ImageAcquireSuccess will be nil which is not false. If there is a problem concerning acquiring the image then the pod will just exit on error and the Job will hang until timeout (which is what is currently happening)

Also I think it's worth doing a PR for not going to image inspector if the image is archived, WDYT?

Yes, I will take care of it

@moolitayer moolitayer merged commit df06507 into ManageIQ:master Nov 30, 2017
@moolitayer moolitayer added this to the Sprint 75 Ending Dec 11, 2017 milestone Nov 30, 2017
@moolitayer moolitayer self-assigned this Dec 27, 2017
@cben
Copy link
Contributor

cben commented Feb 22, 2018

please set backport labels according to BZs.

@enoodle
Copy link
Author

enoodle commented Feb 22, 2018

@miq-bot add_label gaprindashvili/yes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants