Skip to content

Commit

Permalink
lose the container prefix in pod events
Browse files Browse the repository at this point in the history
  • Loading branch information
Ari Zellner committed Dec 21, 2017
1 parent 5a4b012 commit 8a1ffe7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ def extract_event_data(event)
/^spec.containers{(?<container_name>.*)}$/ =~ event_data[:fieldpath]
unless container_name.nil?
event_data[:container_name] = container_name
event_data[:reason] = "Container" + event_data[:reason] # Failed ~> ContainerFailed
end
event_data[:container_group_name] = event_data[:name]
event_data[:container_namespace] = event_data[:namespace]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,21 +63,21 @@ def initialize(ems = nil)
}
end

it 'extracts CONTAINER_KILLING data' do
it 'extracts KILLING data' do
expected_data = {
:timestamp => '2016-07-21T20:01:56Z',
:kind => 'Pod',
:name => 'heapster-aas69',
:namespace => 'openshift-infra',
:reason => 'ContainerKilling',
:reason => 'Killing',
:message => 'Killing container with docker id 18a563fdb87c: failed to call event handler: '\
'Error executing in Docker Container: -1',
:uid => '72d3098a-4f6a-11e6-b177-525400c7c086',
:fieldpath => 'spec.containers{heapster}',
:container_name => 'heapster',
:container_group_name => 'heapster-aas69',
:container_namespace => 'openshift-infra',
:event_type => 'POD_CONTAINERKILLING'
:event_type => 'POD_KILLING'
}
event = array_recursive_ostruct(:object => kubernetes_event)
expect(test_class.new.extract_event_data(event)).to eq(expected_data)
Expand Down

0 comments on commit 8a1ffe7

Please sign in to comment.