-
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 non existent container showing in report #15405
Fix non existent container showing in report #15405
Conversation
@miq-bot add_label containers/providers bug wip |
@simon3z we should probably review the other container related reports and make sure this behavior is the same for them also.. what do you think? |
@nimrodshn Cannot apply the following label because they are not recognized: containers/providers bug wip |
1 similar comment
@nimrodshn Cannot apply the following label because they are not recognized: containers/providers bug wip |
@miq-bot add_labels containers/providers, bug, wip |
@nimrodshn Cannot apply the following label because they are not recognized: containers/providers |
@kbrock ended up using you're solution 👍 |
conditions: !ruby/object:MiqExpression
exp:
IS NOT NULL:
field: ContainerGroup.ext_management_system-name This heavily relies on the underlying implementation 😢 What if the deletion will be handled with an extra I feel we should rely on an explicit attribute of the objects... I think there is the |
@simon3z I think leveraging the Currently, |
@nimrodshn that's why I said |
@simon3z I'll give it a try 👍 |
@nimrodshn @simon3z yeah, |
667c5e5
to
2cb802b
Compare
@simon3z move to |
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.
Thanks @nimrodshn
looking good
@simon3z PTAL. |
@kbrock ready for merge 👍 |
@gtanzillo @lpichler please review/merge, this report is ready. 😇 |
conditions: !ruby/object:MiqExpression | ||
exp: | ||
IS NOT NULL: | ||
field: ContainerGroup.deleted_on |
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.
this is working?
the syntax is defined in MiqExpression::Field::REGEX
(just fyi it is not needed to read the regex :) )
for this case it should be ContainerGroup-deleted_on
, the "." is for relations(ContainerGroup.ext_management_system-name
).
MiqExpression::Field.parse('ContainerGroup-deleted_on')
=> true
MiqExpression::Field.parse('ContainerGroup.deleted_on')
=> nil
so please use 'ContainerGroup-deleted_on' (and also in other places)
add minor refactoring refactored reports
2cb802b
to
61a54e7
Compare
@lpichler fixed 👍 |
Checked commit nimrodshn@61a54e7 with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0 |
@Ladas are there other tables/reports that need to add a |
@kbrock I think we have total 5 tables with deleted on for containers, those having active scope in https://github.com/Ladas/manageiq/blob/e7f155589c2342b10780accab2aab4539ae14b48/app/models/manageiq/providers/container_manager.rb#L11) @cben we miss active scope for container nodes? Do we have a PR? |
cc @zakiva If I understand this report correctly, it queries Is it good for reports to depend on |
@cben - darn. good point. Is someone adding |
@kbrock ArchivedMixin?
Probably didn't understand what you meant there @cben. Isn't this why we are adding the condition (maybe you were responding to something)
We would definitely be better off by relying on ArchivedMixin's methods. I don't know if that makes sense in this context - looks like reports are designed to go straight to the DB. Can we use a default scope for that goal? 2.3.0 :010 > class User < ActiveRecord::Base
2.3.0 :011?> default_scope { where(:name => 'admin')}
2.3.0 :012?> end
=> [#<Proc:0x00000008378ea0@(irb):11>]
2.3.0 :013 > User.all
User Load (84.9ms) SELECT "users".* FROM "users" WHERE "users"."name" = $1 [["name", "admin"]]
User Inst Including Associations (0.0ms - 0rows)
=> #<ActiveRecord::Relation []>
2.3.0 :014 > |
@miq-bot add_label fine/yes |
@nimrodshn @Ladas @cben keep me honest we can backport this to fine, the |
@simon3z yes if there is the btw. we don't have an index on deleted_on column in Fine, but it should not hurt the perf, since ContainerGroup table is pretty small (PG will probably do sequential scan instead of using the index anyway) |
@moolitayer no to |
…n_report Fix non existent container showing in report (cherry picked from commit e5ff9de) https://bugzilla.redhat.com/show_bug.cgi?id=1484895
Fine backport details:
|
…ainers_in_report Fix non existent container showing in report (cherry picked from commit e5ff9de) https://bugzilla.redhat.com/show_bug.cgi?id=1484895
Currently, we output 'archived' containers to the user in the report 'Pods per Ready Status'.
In this PR we fix this behavior to only show the user the current containers.
BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1435958
Screenshots:
-Before:
-After:
Notice the list shrunk from 14 to 9.
cc: @simon3z @moolitayer @kbrock