Bug 1653871 - Not able to blacklist events for the Openshift Provider
Summary: Not able to blacklist events for the Openshift Provider
Keywords:
Status: CLOSED CURRENTRELEASE
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.10.0
Assignee: Adam Grare
QA Contact: juwatts
Red Hat CloudForms Documentation
URL:
Whiteboard:
: 1652302 (view as bug list)
Depends On:
Blocks: 1658338
TreeView+ depends on / blocked
 
Reported: 2018-11-27 19:27 UTC by Jared Deubel
Modified: 2022-03-13 16:14 UTC (History)
10 users (show)

Fixed In Version: 5.10.0.29
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1658338 (view as bug list)
Environment:
Last Closed: 2019-02-12 16:50:34 UTC
Category: ---
Cloudforms Team: Container Management
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Jared Deubel 2018-11-27 19:27:41 UTC
Description of problem:
Not able to blacklist events for the Openshift Provider. This should be consistent with the other providers that we allow this.  

Version-Release number of selected component (if applicable):
5.9.3.4

Comment 3 Nick Carboni 2018-11-27 20:25:10 UTC
*** Bug 1652302 has been marked as a duplicate of this bug. ***

Comment 7 CFME Bot 2018-12-11 14:22:55 UTC
New commit detected on ManageIQ/manageiq-providers-kubernetes/hammer:

https://github.com/ManageIQ/manageiq-providers-kubernetes/commit/7d7c6e215453cf93114b101af7222376d840912c
commit 7d7c6e215453cf93114b101af7222376d840912c
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=1653871

 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 9 juwatts 2018-12-18 19:53:30 UTC
Verified in 5.10.0.29.20181211195209_fd990a9

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-17T16:10:36.451308 #17862:984f7c]  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-17T21:10:35Z", :kind=>"Pod", :name=>"hello-openshift", :namespace=>"juwatts-test", :reason=>"Created", :message=>"Created container", :uid=>"31b7ea49-0240-11e9-b13b-001a4a520006", :event_uid=>"326cb566-0240-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):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>


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


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