Skip to content

Commit

Permalink
Make container events belong to pod
Browse files Browse the repository at this point in the history
  • Loading branch information
Ari Zellner committed Dec 3, 2017
1 parent f58659b commit 09b20cc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ def extract_event_data(event)
when 'Pod'
/^spec.containers{(?<container_name>.*)}$/ =~ event_data[:fieldpath]
unless container_name.nil?
event_type_prefix = "CONTAINER"
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 @@ -69,15 +69,15 @@ def initialize(ems = nil)
:kind => 'Pod',
:name => 'heapster-aas69',
:namespace => 'openshift-infra',
:reason => 'Killing',
:reason => 'ContainerKilling',
: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 => 'CONTAINER_KILLING'
:event_type => 'POD_CONTAINERKILLING'
}
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 09b20cc

Please sign in to comment.