Bug 1658338 - Not able to blacklist events for the Openshift Provider
Summary: Not able to blacklist events for the Openshift Provider
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: Providers
Version: 5.9.3
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: GA
: 5.9.7
Assignee: Adam Grare
QA Contact: juwatts
Red Hat CloudForms Documentation
URL:
Whiteboard:
Depends On: 1653871
Blocks: 1658378
TreeView+ depends on / blocked
 
Reported: 2018-12-11 19:35 UTC by Satoe Imaishi
Modified: 2022-03-13 16:27 UTC (History)
5 users (show)

Fixed In Version: 5.9.7.0
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 1653871
Environment:
Last Closed: 2019-01-23 14:35:55 UTC
Category: ---
Cloudforms Team: Container Management
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2019:0110 0 None None None 2019-01-23 14:36:05 UTC

Comment 2 CFME Bot 2018-12-14 18:07:00 UTC
New commit detected on ManageIQ/manageiq-providers-kubernetes/gaprindashvili:

https://github.com/ManageIQ/manageiq-providers-kubernetes/commit/f52ea8b34427e5606b6b3d6862f24e3428e92a5d
commit f52ea8b34427e5606b6b3d6862f24e3428e92a5d
Author:     Beni Cherniavsky-Paskin <cben>
AuthorDate: Wed Nov 28 09:51:31 2018 -0500
Commit:     Beni Cherniavsky-Paskin <cben>
CommitDate: Wed Nov 28 09:51:31 2018 -0500

    Merge pull request #309 from agrare/refactor_filtered_method

    Refactor the event catcher filtered? method

    (cherry picked from commit c65237ce59baaa78403f5522845725c0a9050868)

    Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1658338

 app/models/manageiq/providers/kubernetes/container_manager/event_catcher_mixin.rb | 10 +-
 spec/models/manageiq/providers/kubernetes/container_manager/event_catcher_mixin_spec.rb | 101 +
 2 files changed, 105 insertions(+), 6 deletions(-)

Comment 3 juwatts 2018-12-18 21:09:22 UTC
Verified in 5.9.7.0.20181217174909_1f8a1d7

Verification Steps:

1) Added a OpenShift provider to the CloudForms appliance
2) On the CloudForms appliance CLI, navigated to /var/www/miq/vmdb/log and tailed evm.log
3) On the OpenShift provider, created a new pod
4) Verified in the evm log, the following message:

[----] I, [2018-12-18T15:32:17.466125 #2278:da910c]  INFO -- : MIQ(ManageIQ::Providers::Openshift::ContainerManager::EventCatcher::Runner#queue_event) EMS [env-ocp-master-v1.cmqe.lab.eng.rdu2.redhat.com] as [] Queuing event [{:timestamp=>"2018-12-18T20:32:16Z", :kind=>"Pod", :name=>"hello-openshift", :namespace=>"juwatts-test", :reason=>"Created", :message=>"Created container", :uid=>"01d4749e-0304-11e9-b13b-001a4a520006", :event_uid=>"028573dd-0304-11e9-b13b-001a4a520006", :fieldpath=>"spec.containers{hello-openshift}", :container_name=>"hello-openshift", :container_group_name=>"hello-openshift", :container_namespace=>"juwatts-test", :event_type=>"POD_CREATED"}]


5) Verified the blacklisted_event table before adding an event:

irb(main):005:0> ManageIQ::Providers::Openshift::ContainerManager.first.blacklisted_event_names
=> []
irb(main):006:0> 


6) On the CloudForms GUI, added POD_CREATED to ems.ems_openshift.blacklisted_event_names in the settings yaml.

:ems_openshift:
    :blacklisted_event_names:
    - POD_CREATED
    :event_handling:
      :event_groups:

7) Ran the following command on the CloudForms CLI: systemctl restart evmserverd
8) On the OpenShift provider, created a new pod
9) Verified that the POD_CREATED event in the log is no longer logged 
10) Verified an entry is added in the blacklisted_event_names DB table:

irb(main):001:0> ManageIQ::Providers::Openshift::ContainerManager.first.blacklisted_event_names
PostgreSQLAdapter#log_after_checkout, connection_pool: size: 5, connections: 1, in use: 1, waiting_in_queue: 0
=> ["POD_CREATED"]
irb(main):002:0> 

11) Removed POD_CREATED from the settings yaml
12) Cleaned the blacklisted_event_name table:

BlacklistedEvent.last.destroy!

13) Ran the following command on the CloudForms CLI: systemctl restart evmserverd 

14) Verified the DB has been cleared:

irb(main):001:0> ManageIQ::Providers::Openshift::ContainerManager.first.blacklisted_event_names
PostgreSQLAdapter#log_after_checkout, connection_pool: size: 5, connections: 1, in use: 1, waiting_in_queue: 0
=> []
irb(main):002:0> 


15) On the OpenShift provider, created a new pod
16) Verified POD_CREATED is now being displayed in the logs

[----] I, [2018-12-18T16:08:10.767225 #8244:39b110]  INFO -- : MIQ(ManageIQ::Providers::Openshift::ContainerManager::EventCatcher::Runner#queue_event) EMS [env-ocp-master-v1.cmqe.lab.eng.rdu2.redhat.com] as [] Queuing event [{:timestamp=>"2018-12-18T21:08:10Z", :kind=>"Pod", :name=>"hello-openshift", :namespace=>"juwatts-test", :reason=>"Created", :message=>"Created container", :uid=>"0572e75c-0309-11e9-b13b-001a4a520006", :event_uid=>"0650c58c-0309-11e9-b13b-001a4a520006", :fieldpath=>"spec.containers{hello-openshift}", :container_name=>"hello-openshift", :container_group_name=>"hello-openshift", :container_namespace=>"juwatts-test", :event_type=>"POD_CREATED"}]

Comment 5 errata-xmlrpc 2019-01-23 14:35:55 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2019:0110


Note You need to log in before you can comment on or make changes to this bug.