-
Notifications
You must be signed in to change notification settings - Fork 897
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
Added container components for service model. #12863
Conversation
@@ -0,0 +1,4 @@ | |||
module MiqAeMethodService | |||
class MiqAeServiceContainer < MiqAeServiceModelBase |
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.
@kevensen
From the service model are you planning on exposing its relationships or just the attributes.
With the current implementation only the attributes are going to be exposed and not any relationships.
https://github.com/ManageIQ/manageiq/blob/master/lib/miq_automation_engine/service_models/miq_ae_service_host.rb#L6 shows how we expose relationships
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.
@mkanoor I want to expose some of the relationships. Thank you for the tip. I'll update the pull request in the next day or two. Or would you rather me close this request and open a new one?
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.
@kevensen
You can just add new commits to this PR
@kevensen |
@mkanoor - I've looked at the specs for the service model exposed associations. Please forgive me that my Ruby is a little weak. Are these specs checked at runtime? Or are these like unit tests? |
@kevensen |
@mkanoor - I've completed the service model, associations, and specs. At your convenience please review. I look forward to and appreciate any feedback you have. |
@@ -1,3 +1,9 @@ | |||
class ContainerComponentStatus < ApplicationRecord | |||
belongs_to :ext_management_system, :foreign_key => "ems_id" | |||
|
|||
virtual_column :name, :type => :string |
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.
@blomquisg
Hi Greg can you have someone from provider team review the app/models changes.
@kevensen |
Checked commit kevensen@78cfe13 with ruby 2.2.5, rubocop 0.37.2, and haml-lint 0.16.1 |
@mkanoor Certainly. I've reverted those files back. |
@kevensen Is this valid for back-port to the Euwe branch? Please label |
@gmcculloug I just ran the test suite against these components in the euwe branch and it looked fine. So, yes, I believe this is valid for a back-port. I'd be happy to change the label, but not being a member I don't think I have the permission to do so. |
@kevensen I set the flag but it is also available for others through the |
Still waiting for bz creation but we asked https://bugzilla.redhat.com/show_bug.cgi?id=1437128 marked as a blocker for euwe. @miq-bot add_label blocker |
@gmcculloug I'm looking into unit testing the automate part in container SSA (check policy prevent). Do you have any pointers (other tests that run an automate worker?) |
Added container components for service model. (cherry picked from commit 3650d79) https://bugzilla.redhat.com/show_bug.cgi?id=1437128
Euwe backport details:
|
It would be great if these service models could support custom attributes so that we could label the objects from automate |
@pemcg @kevensen If the active_record models support custom_attributes there is a service_model mixin for adding the accessor methods: MiqAeServiceCustomAttributeMixin |
@pemcg @gmcculloug For a frame of reference, can you please remind me what would be a custom attribute for a VM? I think it would be a good idea to tie these to labels on container resources. |
Custom attributes allow users to add their own key/value text pairs to objects. A typical example might be a Configuration ID from a CMDB, or a 'status' text string. It's useful to be able to define them from automate using the This chapter https://pemcg.gitbooks.io/mastering-automation-in-cloudforms-4-2-and-manage/content/working_with_virtual_machines/chapter.html describes how to set custom attributes on a VM if it helps. |
OpenShift (and theoretically other container platforms) objects should be treated as first class citizens in the Automate Service Model in ManageIQ. This will enable customized workflows using these objects.
This pull request only adds code that allows one to Read the objects. Future work will be made to allow an automate workflow to Create, Update, and Delete the objects.
https://bugzilla.redhat.com/show_bug.cgi?id=1378190