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
Hi Oved, I believe this calls for a setting to be added to config/settings.yml, as we did for other providers, see Azure example: https://github.com/ManageIQ/manageiq-providers-azure/blob/master/config/settings.yml#L21..L24 https://github.com/ManageIQ/manageiq-providers-azure/blob/master/app/models/manageiq/providers/azure/cloud_manager.rb#L61..L63 https://github.com/ManageIQ/manageiq-providers-azure/blob/master/app/models/manageiq/providers/azure/cloud_manager/event_catcher/runner.rb#L47
*** Bug 1652302 has been marked as a duplicate of this bug. ***
https://github.com/ManageIQ/manageiq-providers-kubernetes/pull/308
https://github.com/ManageIQ/manageiq-providers-kubernetes/pull/309
https://github.com/ManageIQ/manageiq-providers-kubernetes/pull/309 was merged
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(-)
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