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

[EUWE] Identifying container images by registry, name and digest #14396

Merged

Conversation

enoodle
Copy link

@enoodle enoodle commented Mar 19, 2017

The image-ref is not a reliable source to identify images when it comes
from the docker daemon (in the docker://... form). This will identify
the images from the information that we can parse.

Doing so will also enable us to commit the images to the @DaTa hash when
we identify the images instead from a collection function (get_images),
which will simplify image collection from Openshift.

This is a backport to euwe of #14185

@simon3z
Copy link
Contributor

simon3z commented Mar 19, 2017

cc @simaishi

@simon3z
Copy link
Contributor

simon3z commented Mar 19, 2017

@miq-bot assign blomquisg

@simon3z
Copy link
Contributor

simon3z commented Mar 20, 2017

LGTM 👍
@miq-bot assign blomquisg

@simon3z
Copy link
Contributor

simon3z commented Mar 20, 2017

@enoodle please rename this with "[EUWE]" in the title of the PR.

@enoodle enoodle changed the title Identifying container images by registry, name and digest [EUWE] Identifying container images by registry, name and digest Mar 20, 2017
@simaishi simaishi requested a review from blomquisg March 20, 2017 13:14
@miq-bot miq-bot assigned blomquisg and unassigned simaishi Mar 20, 2017
@simaishi simaishi assigned simaishi and unassigned blomquisg Mar 20, 2017
@simaishi
Copy link
Contributor

@blomquisg please approve if this is good to go.

@simon3z
Copy link
Contributor

simon3z commented Mar 20, 2017

@miq-bot assign blomquisg

@simon3z
Copy link
Contributor

simon3z commented Mar 20, 2017

chessbyte assigned simaishi and unassigned blomquisg 35 minutes ago

Oops sorry @chessbyte I didn't notice you reassigned this already.

@@ -36,6 +36,7 @@ class ContainerImage < ApplicationRecord
after_create :raise_creation_event

def full_name
docker_id if image_ref && image_ref.start_with?(DOCKER_PULLABLE_PREFIX)
Copy link
Member

Choose a reason for hiding this comment

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

This looks like a no-op line to me. It will evaluate docker_id, but docker_id isn't actually used in this method anywhere.

Did you mean to return docker_id?

EDIT:

The best part is I merged this same change upstream...

Copy link
Author

Choose a reason for hiding this comment

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

@blomquisg yes, thank you

Copy link
Contributor

Choose a reason for hiding this comment

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

@blomquisg 😮 kudos!
@enoodle please fix this here and on master as well.

@blomquisg
Copy link
Member

@enoodle one comment about the full_name method.

@enoodle enoodle force-pushed the better_identify_container_images_euwe branch from a92f8dd to 51a4108 Compare March 20, 2017 17:29
@@ -36,6 +36,7 @@ class ContainerImage < ApplicationRecord
after_create :raise_creation_event

def full_name
return docker_id if image_ref && image_ref.start_with?(DOCKER_PULLABLE_PREFIX)
Copy link
Contributor

Choose a reason for hiding this comment

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

@enoodle how come the tests were not failing before? We're not covering this with a test?

Copy link
Contributor

@simon3z simon3z Mar 20, 2017

Choose a reason for hiding this comment

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

Update: @enoodle added a new test here

@enoodle
Copy link
Author

enoodle commented Mar 20, 2017

@blomquisg I will add a test here, will ping you back in 30 minutes :)

@enoodle enoodle changed the title [EUWE] Identifying container images by registry, name and digest [WIP][EUWE] Identifying container images by registry, name and digest Mar 20, 2017
@miq-bot miq-bot added the wip label Mar 20, 2017
The image-ref is not a reliable source to identify images when it comes
from the docker daemon (in the docker://... form). This will identify
the images from the information that we can parse.

Doing so will also enable us to commit the images to the @DaTa hash when
we identify the images instead from a collection function (get_images),
which will simplify image collection from Openshift.
@enoodle enoodle force-pushed the better_identify_container_images_euwe branch from 51a4108 to 931d0ab Compare March 20, 2017 17:45
@miq-bot
Copy link
Member

miq-bot commented Mar 20, 2017

Checked commit enoodle@931d0ab with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0
6 files checked, 2 offenses detected

app/models/manageiq/providers/kubernetes/container_manager/refresh_parser.rb

spec/models/manageiq/providers/openshift/container_manager/refresh_parser_spec.rb

@enoodle enoodle changed the title [WIP][EUWE] Identifying container images by registry, name and digest [EUWE] Identifying container images by registry, name and digest Mar 20, 2017
@enoodle
Copy link
Author

enoodle commented Mar 20, 2017

@blomquisg Ok, I fixed the problem with full_name and added a test for this.

@simon3z
Copy link
Contributor

simon3z commented Mar 20, 2017

LGTM 👍 cc @blomquisg

@miq-bot miq-bot removed the wip label Mar 20, 2017
@blomquisg
Copy link
Member

@enoodle can you submit the same change to the full_name method (and the related test) to master as well?

@enoodle
Copy link
Author

enoodle commented Mar 20, 2017

@blomquisg Yes, I will link it here in a few minutes

@simaishi simaishi merged commit 4fd19f5 into ManageIQ:euwe Mar 20, 2017
@simaishi simaishi added this to the Sprint 57 Ending Mar 27, 2017 milestone Mar 20, 2017
@blomquisg
Copy link
Member

Thanks @enoodle!!

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