fluent-plugin-wodby 0.1.6 → 0.1.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 54078ee6dd1cfe2697b08912aaba863c151f87ce64811a1057635a92ae568065
4
- data.tar.gz: a13f8a3497af7789aa056eed9bdab5ffaf19957844dd26eabb5826739d45a5af
3
+ metadata.gz: 492f5e148c2250501ee81ee6f08bfa08c41f09a66929dacef07004bdf4b28acf
4
+ data.tar.gz: ac9462d3082ec76baf70c0d37f638cd1239a412998b6b1d646fb3bbcb15fe59b
5
5
  SHA512:
6
- metadata.gz: b6dae147f6aa895fd9fc288bfaeaa55e94b634ede93c9c2dcae3c4b856ae0118f4f642e8a37bd1ad47f3fd7c0b99e269ede0c87e1ffee5813fdedfed2369244c
7
- data.tar.gz: 9f656160c71fa19773f7eb021e456f299b0342dc794ce69e9a3adfa4f1aa5b92a301ff1bb5c4d761a414bc777add31b6635b595c011429d00139edc7fe7f40fb
6
+ metadata.gz: d049cdb926cb164f9e22154ede1ede14984376e181064e1eece3d160ff4ce52753b1196f45865715514dd5a5af869461026ca644b81d791c67500cb36779e485
7
+ data.tar.gz: 20015f81fe49ae01d9e48d5236486c8222114a8ec979c58f322e4bfe0c83a4e604f39804a39afcef254c80821ac44b1099fd75f8fcffa0957e69de12ecdb0701
@@ -3,7 +3,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
3
 
4
4
  Gem::Specification.new do |spec|
5
5
  spec.name = "fluent-plugin-wodby"
6
- spec.version = "0.1.6"
6
+ spec.version = "0.1.7"
7
7
  spec.authors = ["Robert Wunderer"]
8
8
  spec.email = ["robert@ramsalt.com"]
9
9
 
@@ -34,16 +34,17 @@ module Fluent
34
34
  def filter(tag, time, record)
35
35
  record['wodby.filter'] = true
36
36
 
37
- if record.has_key?('kubernetes.namespace_name')
38
- unless @instance_map.has_key?(record['kubernetes.namespace_name'])
39
- record['wodby.instance_query'] = record['kubernetes.namespace_name']
40
- instance = get_instance(record['kubernetes.namespace_name'])
37
+ if record.has_key?('kubernetes') && record['kubernetes'].has_key?('namespace_name')
38
+ namespace = record['kubernetes']['namespace_name']
39
+ unless @instance_map.has_key?(namespace)
40
+ record['wodby.instance_query'] = namespace
41
+ instance = get_instance(namespace)
41
42
  app = get_app(instance['app_id'])
42
43
 
43
- @instance_map[record['kubernetes.namespace_name']] = "#{app['title']}-#{instance['name']}"
44
+ @instance_map[namespace] = "#{app['title']}-#{instance['name']}"
44
45
  end
45
46
 
46
- record['wodby.instance'] = @instance_map[record['kubernetes.namespace_name']]
47
+ record['wodby.instance'] = @instance_map[namespace]
47
48
  else
48
49
  log.info "No namespace found"
49
50
  log.info record
@@ -16,9 +16,9 @@ class WodbyFilterTest < Test::Unit::TestCase
16
16
  d = create_driver("api_key #{ENV['WODBY_API_KEY']}")
17
17
  time = event_time
18
18
  d.run do
19
- d.feed('filter.test', time, { 'kubernetes.namespace_name' => '650241f4-7303-4668-91c7-b8cd1821d81a', 'message' => 'hullo' })
20
- d.feed('filter.test', time, { 'kubernetes.namespace_name' => 'a3d67f12-8341-4245-87db-ed7a6c856e70', 'message' => 'hullo' })
21
- d.feed('filter.test', time, { 'kubernetes.namespace_name' => '650241f4-7303-4668-91c7-b8cd1821d81a', 'message' => 'hullo' })
19
+ d.feed('filter.test', time, { 'kubernetes' => {'namespace_name' => '650241f4-7303-4668-91c7-b8cd1821d81a'}, 'message' => 'hullo' })
20
+ d.feed('filter.test', time, { 'kubernetes' => {'namespace_name' => 'a3d67f12-8341-4245-87db-ed7a6c856e70'}, 'message' => 'hullo' })
21
+ d.feed('filter.test', time, { 'kubernetes' => {'namespace_name' => '650241f4-7303-4668-91c7-b8cd1821d81a'}, 'message' => 'hullo' })
22
22
  end
23
23
 
24
24
  assert_equal(3, d.filtered_records.size)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-wodby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robert Wunderer