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

Adding openshift_container_images #23

Merged

Conversation

enoodle
Copy link

@enoodle enoodle commented Jun 15, 2017

Addes openshift_container_images to the openshift provider.
Adding parsing for ems_ref for images originating from Openshift.

based on: ManageIQ/manageiq#15386

@enoodle enoodle changed the title Processing for OpenshiftContainerImage [WIP] Processing for OpenshiftContainerImage Jun 15, 2017
@miq-bot miq-bot added the wip label Jun 15, 2017
@enoodle enoodle force-pushed the openshift_container_image_class_processing branch from 4f18efe to 4410d13 Compare June 15, 2017 13:53
@enoodle enoodle changed the title [WIP] Processing for OpenshiftContainerImage Adding openshift_container_images Jun 15, 2017
@enoodle enoodle force-pushed the openshift_container_image_class_processing branch from 4410d13 to f04f0e1 Compare June 15, 2017 13:55
@miq-bot miq-bot removed the wip label Jun 15, 2017
@enoodle enoodle force-pushed the openshift_container_image_class_processing branch 3 times, most recently from 6c2aa9f to dfacf0e Compare June 18, 2017 13:19
@@ -0,0 +1,13 @@
class ManageIQ::Providers::Openshift::ContainerImage < ContainerImage

Choose a reason for hiding this comment

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

class ManageIQ::Providers::Openshift::ContainerManager::ContainerImage < ContainerImage
Also change path

@enoodle enoodle force-pushed the openshift_container_image_class_processing branch 2 times, most recently from b935586 to 7119e22 Compare June 19, 2017 12:15
@enoodle
Copy link
Author

enoodle commented Jun 19, 2017

@moolitayer done

@@ -8,6 +8,8 @@ class ManageIQ::Providers::Openshift::ContainerManager < ManageIQ::Providers::Co
require_nested :RefreshWorker
require_nested :Refresher

has_many :openshift_container_images, :foreign_key => :ems_id, :dependent => :destroy
Copy link

@moolitayer moolitayer Jun 19, 2017

Choose a reason for hiding this comment

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

We don't need this now right?

Copy link
Author

Choose a reason for hiding this comment

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

No, it is just nice to have (I need to add ":class_name => ..." there though) do you want me to remove this?

@enoodle enoodle force-pushed the openshift_container_image_class_processing branch from 7119e22 to cdad41e Compare June 19, 2017 14:55
@@ -8,6 +8,9 @@ class ManageIQ::Providers::Openshift::ContainerManager < ManageIQ::Providers::Co
require_nested :RefreshWorker
require_nested :Refresher

has_many :openshift_container_images, :foreign_key => :ems_id, :dependent => :destroy,
:class_name => 'ManageIQ::Providers::Openshift::ContainerManager::ContainerImage'

Choose a reason for hiding this comment

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

Yes please remove unless you have a solid use case

@enoodle enoodle force-pushed the openshift_container_image_class_processing branch from cdad41e to 6488d0f Compare June 19, 2017 15:14
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.

LTGM 👍

@enoodle
Copy link
Author

enoodle commented Jun 19, 2017

This will require test restart after the base PR ManageIQ/manageiq#15386 is merged

@enoodle enoodle force-pushed the openshift_container_image_class_processing branch from 6488d0f to 630b14f Compare June 20, 2017 14:29
Fryguy
Fryguy previously requested changes Jul 3, 2017
@@ -0,0 +1,13 @@
class ManageIQ::Providers::Openshift::ContainerManager::ContainerImage < ContainerImage
acts_as_miq_taggable
include NewWithTypeStiMixin
Copy link
Member

Choose a reason for hiding this comment

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

These two lines should not be here. They both belong in the base ContainerImage.

@Fryguy
Copy link
Member

Fryguy commented Jul 3, 2017

ManageIQ/manageiq#15386 is merged, so rekicking travis

@@ -175,6 +175,9 @@ def parse_openshift_image(openshift_image)
ref = "#{ContainerImage::DOCKER_PULLABLE_PREFIX}#{id}"
new_result = parse_container_image(id, ref)

#new_result[:ems_ref] = openshift_image.metadata.uid
Copy link
Contributor

Choose a reason for hiding this comment

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

@enoodle do we need this comment?

Copy link
Author

Choose a reason for hiding this comment

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

@simon3z No, I commented this out because of ManageIQ/manageiq-schema#21 (comment)

Do you think we should remove this column or put the digest there? Anything else we can do?

Choose a reason for hiding this comment

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

what do you use the ems_ref for?

@enoodle
Copy link
Author

enoodle commented Jul 10, 2017

I removed the processing of ems_ref from this PR, and created ManageIQ/manageiq-schema#38 to remove this column. @moolitayer @Fryguy @simon3z PTAL.

@enoodle
Copy link
Author

enoodle commented Jul 13, 2017

@moolitayer @simon3z
ManageIQ/manageiq-schema#38 seems not to be an issue, as this current PR is not touching ems_ref.
BUT, This PR now coupled with ManageIQ/manageiq#15519. These two PRs should be merged together as this one will introduce a problem with SSA for containers that ManageIQ/manageiq#15519 will solve, but due to the tests in ManageIQ/manageiq#15519 it needs this one to be green. Any advice?

@moolitayer
Copy link

@enoodle I didn't understand. On what is ManageIQ/manageiq#15519 dependent?

@enoodle
Copy link
Author

enoodle commented Jul 13, 2017

@moolitayer The tests in ManageIQ/manageiq#15519 are red because they need the container image class definition from this PR.

@lpichler
Copy link

Note:
without this PR and after migrating records by this migration

AR queries on ContainerImage ( with type=ManageIQ::Providers::Openshift::ContainerManager::ContainerImage) are failing.

ContainerImage.first =>
ActiveRecord::SubclassNotFound: The single-table inheritance mechanism failed to locate the 
subclass: 'ManageIQ::Providers::Openshift::ContainerManager::ContainerImage'.
 This error is raised because the column 'type' is reserved for storing the class in case of 
inheritance.
 Please rename this column if you didn't intend it to be used for storing the inheritance class or overwrite ContainerImage.inheritance_column to use another column for that information.

lpichler added a commit to lpichler/manageiq-ui-classic that referenced this pull request Jul 14, 2017
This is also fixing error about missing `ManageIQ::Providers::Openshift::ContainerManager::ContainerImage`
ManageIQ/manageiq-providers-openshift#23 (comment)
@@ -0,0 +1,12 @@
class ManageIQ::Providers::Openshift::ContainerManager::ContainerImage < ContainerImage
acts_as_miq_taggable

Choose a reason for hiding this comment

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

Having this in the base class is not enough?

digest,
"security.manageiq.org/failed-policy" => causing_policy,
"images.openshift.io/deny-execution" => "true"
)

Choose a reason for hiding this comment

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

We need a PR removing this method from manageiq/manageiq

Copy link
Author

Choose a reason for hiding this comment

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

ManageIQ/manageiq#15386 it is already merged.

@enoodle enoodle force-pushed the openshift_container_image_class_processing branch from 6a848e3 to ad5ac8a Compare July 16, 2017 11:32
@miq-bot
Copy link
Member

miq-bot commented Jul 16, 2017

Checked commit enoodle@ad5ac8a with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0
4 files checked, 0 offenses detected
Everything looks fine. 🍪

@simon3z
Copy link
Contributor

simon3z commented Jul 17, 2017

@Fryguy you requested changes here. Can you check if it's OK now and update your review status? Thanks!

@simon3z
Copy link
Contributor

simon3z commented Jul 20, 2017

My concerns were removed

Thanks @Fryguy !

@moolitayer moolitayer added this to the Sprint 65 Ending Jul 24, 2017 milestone Aug 9, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants