-
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
Fix alerts based on hourly timer for container entities #16902
Conversation
@@ -8,6 +8,7 @@ class Zone < ApplicationRecord | |||
|
|||
has_many :miq_servers | |||
has_many :ext_management_systems | |||
has_many :container_managers, :class_name => "ManageIQ::Providers::ContainerManager" |
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.
I wish we didnt need this and i could just have the lines below as:
has_many :container_nodes, :through => :ext_management_systems
instead.
suggestions?
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.
(made with https://dev.to/rly)
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.
I find your solution pretty neat, actually 👍. But I'm not a rails expert.
app/models/zone.rb
Outdated
@@ -19,6 +20,8 @@ class Zone < ApplicationRecord | |||
has_many :vms, :through => :ext_management_systems | |||
has_many :miq_templates, :through => :ext_management_systems | |||
has_many :ems_clusters, :through => :ext_management_systems | |||
has_many :container_nodes, :through => :container_managers | |||
has_many :container_projects, :through => :container_managers |
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.
what other container entities make sense here? Pods? Containers?
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.
I'm not sure anything except EMS and N=ode is possible in UI.
4bd7f27
to
3258774
Compare
Checked commit zeari@3258774 with ruby 2.3.3, rubocop 0.52.0, haml-lint 0.20.0, and yamllint 1.10.0 app/models/zone.rb
spec/models/miq_alert_spec.rb
|
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.
LGTM
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.
looks good 👍
@kbrock we should probably fill in the inverse_of options?
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.
👍 LGTM
I wish we didnt need this and i could just have the lines below as:
has_many :container_nodes, :through => :ext_management_systems
instead.
Yeah this is the other side of pushing the more specific associations down to the specific managers and not cluttering ExtManagementSystem
...trade offs on both sides I think
This is the same as the existing associations so if we're going to fix it should be in a follow-up PR |
BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1496838
Alerts driven by hourly timer that evaluate an expression would fail for container entities that had no relationship to
Zone
. Added,ContainerProject
ContainerNode
,ContainerReplicator
,Container
,ContainerGroup
.@cben @moolitayer PTAL
cc @oourfali
@miq-bot add_label bug, providers/containers