diff --git a/app/models/manageiq/providers/kubernetes/container_manager/event_catcher_mixin.rb b/app/models/manageiq/providers/kubernetes/container_manager/event_catcher_mixin.rb index d64dfa89b4..11efb55ee6 100644 --- a/app/models/manageiq/providers/kubernetes/container_manager/event_catcher_mixin.rb +++ b/app/models/manageiq/providers/kubernetes/container_manager/event_catcher_mixin.rb @@ -66,7 +66,8 @@ def extract_event_data(event) :namespace => event.object.involvedObject.namespace, :reason => event.object.reason, :message => event.object.message, - :uid => event.object.involvedObject.uid + :uid => event.object.involvedObject.uid, + :event_uid => event.object.metadata.uid, } unless event.object.involvedObject.fieldPath.nil? diff --git a/app/models/manageiq/providers/kubernetes/container_manager/event_parser_mixin.rb b/app/models/manageiq/providers/kubernetes/container_manager/event_parser_mixin.rb index 311dcd70d2..26c6ae9c5d 100644 --- a/app/models/manageiq/providers/kubernetes/container_manager/event_parser_mixin.rb +++ b/app/models/manageiq/providers/kubernetes/container_manager/event_parser_mixin.rb @@ -24,7 +24,8 @@ def self.event_to_hash(event, ems_id = nil) :container_namespace => event[:container_namespace], :container_name => event[:container_name], :full_data => event, - :ems_id => ems_id + :ems_id => ems_id, + :ems_ref => event[:event_uid], } event_hash[ems_ref_key] = event[:uid] diff --git a/spec/models/manageiq/providers/kubernetes/container_manager/event_catcher_mixin_spec.rb b/spec/models/manageiq/providers/kubernetes/container_manager/event_catcher_mixin_spec.rb index 56981608e2..969b9c57ac 100644 --- a/spec/models/manageiq/providers/kubernetes/container_manager/event_catcher_mixin_spec.rb +++ b/spec/models/manageiq/providers/kubernetes/container_manager/event_catcher_mixin_spec.rb @@ -77,7 +77,8 @@ def initialize(ems = nil) :container_name => 'heapster', :container_group_name => 'heapster-aas69', :container_namespace => 'openshift-infra', - :event_type => 'POD_KILLING' + :event_type => 'POD_KILLING', + :event_uid => 'fa735ca9-4f7d-11e6-b177-525400c7c086', } event = array_recursive_ostruct(:object => kubernetes_event) expect(test_class.new.extract_event_data(event)).to eq(expected_data) @@ -162,7 +163,8 @@ def initialize(ems = nil) :uid => '7599d451-4c1c-11e6-89dd-525400c7c086', :container_replicator_name => 'mysql-1', :container_namespace => 'proj', - :event_type => 'REPLICATOR_SUCCESSFULCREATE' + :event_type => 'REPLICATOR_SUCCESSFULCREATE', + :event_uid => '4c513e6d-525d-11e6-8564-525400c7c086', } event = array_recursive_ostruct(:object => kubernetes_event) expect(test_class.new.extract_event_data(event)).to eq(expected_data) @@ -213,7 +215,8 @@ def initialize(ems = nil) 'c75d2b66-6d5b-49e0-b906-1d8abaf3e73b', :uid => 'd30a880d-dfa7-11e5-af89-525400c7c086', :container_node_name => 'vm-test-03.example.com', - :event_type => 'NODE_REBOOTED' + :event_type => 'NODE_REBOOTED', + :event_uid => 'a4b92ae1-5251-11e6-8564-525400c7c086', } end