Bug 1653871
| Summary: | Not able to blacklist events for the Openshift Provider | |||
|---|---|---|---|---|
| Product: | Red Hat CloudForms Management Engine | Reporter: | Jared Deubel <jdeubel> | |
| Component: | Providers | Assignee: | Adam Grare <agrare> | |
| Status: | CLOSED CURRENTRELEASE | QA Contact: | juwatts | |
| Severity: | high | Docs Contact: | Red Hat CloudForms Documentation <cloudforms-docs> | |
| Priority: | high | |||
| Version: | 5.9.3 | CC: | agrare, akarol, dmetzger, izapolsk, jfrey, jhardy, jocarter, obarenbo, simaishi, tuado | |
| Target Milestone: | GA | Keywords: | TestOnly, ZStream | |
| Target Release: | 5.10.0 | |||
| Hardware: | Unspecified | |||
| OS: | Unspecified | |||
| Whiteboard: | ||||
| Fixed In Version: | 5.10.0.29 | Doc Type: | If docs needed, set a value | |
| Doc Text: | Story Points: | --- | ||
| Clone Of: | ||||
| : | 1658338 (view as bug list) | Environment: | ||
| Last Closed: | 2019-02-12 16:50:34 UTC | Type: | Bug | |
| Regression: | --- | Mount Type: | --- | |
| Documentation: | --- | CRM: | ||
| Verified Versions: | Category: | --- | ||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | ||
| Cloudforms Team: | Container Management | Target Upstream Version: | ||
| Embargoed: | ||||
| Bug Depends On: | ||||
| Bug Blocks: | 1658338 | |||
|
Description
Jared Deubel
2018-11-27 19:27:41 UTC
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. *** 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
|