fluent-plugin-wodby 0.3.0 → 0.3.1

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: 469eb72bb742f469ad5971d49d596713edbb271956a732c4621098cea1865a96
4
- data.tar.gz: 1bbea99af50452655e065d8e6ef752ba4a682e5198b675aa1abeaeba01455b91
3
+ metadata.gz: 45c8c562d96d1ccf43a9ec81aa7771ac8fd05ed071282119c62581ae4d45f5db
4
+ data.tar.gz: 43e377e23fe30e3af5df48ee6f3c144278339b3c5c18d662705e09ee9e50ce2c
5
5
  SHA512:
6
- metadata.gz: 6659e889809b6f8d613c782425adf2974917a0ffb3915e701975693bf6cb89cfe719ab2b386ce06f778dc203cc82e5c0b5169feb30ce154081d976ef3d41e69a
7
- data.tar.gz: f5ac87623a93140f2486527f93510f83414f1260775b599292e5928fa43a455e54cacde609bf9fceb67e77305b96078efd1ea2e984c8739e00e08116949d3151
6
+ metadata.gz: c1f702cfa38258a6a4cacafbe33d94e4fd9dc3bac2334b8ca7eff3ce5f7e1a9622a76533019f1f69b5da8b2abba8a7e33c2912a9963c8eb399467217dc367eee
7
+ data.tar.gz: 2b42ea373f5daebc31f7fac557d6d45f9939bc93ceb0dd8c3e0e50e127aa17431345a80639d9b07719d1f88c59045fa01d1958f7a8649f63d18b206ff50ce98e
@@ -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.3.0"
6
+ spec.version = "0.3.1"
7
7
  spec.authors = ["Robert Wunderer"]
8
8
  spec.email = ["robert@ramsalt.com"]
9
9
 
@@ -36,6 +36,11 @@ module Fluent
36
36
  'filter' => true
37
37
  }
38
38
 
39
+ if record.has_key?('wodby.node_name')
40
+ record['wodby']['node_name'] = record['wodby.node_name']
41
+ record.delete('wodby.node_name')
42
+ end
43
+
39
44
  if record.has_key?('kubernetes') && record['kubernetes'].has_key?('namespace_name')
40
45
  namespace = record['kubernetes']['namespace_name']
41
46
  unless @instance_map.has_key?(namespace)
@@ -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' => '7ee5d15f-7c3c-4ce8-873e-34b75154f0f4'}, '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', 'wodby.node_name' => 'node' })
20
+ d.feed('filter.test', time, { 'kubernetes' => {'namespace_name' => '7ee5d15f-7c3c-4ce8-873e-34b75154f0f4'}, 'message' => 'hullo', 'wodby.node_name' => 'node' })
21
+ d.feed('filter.test', time, { 'kubernetes' => {'namespace_name' => '650241f4-7303-4668-91c7-b8cd1821d81a'}, 'message' => 'hullo', 'wodby.node_name' => 'node' })
22
22
  end
23
23
 
24
24
  assert_equal(3, d.filtered_records.size)
@@ -27,7 +27,10 @@ class WodbyFilterTest < Test::Unit::TestCase
27
27
  assert_equal('dfono.staging', d.filtered_records[2]['wodby']['instance'])
28
28
  assert_equal('dfo.no - Staging', d.filtered_records[0]['wodby']['instance_title'])
29
29
  assert_equal('dfo.no - Prod', d.filtered_records[1]['wodby']['instance_title'])
30
+ assert_equal('node', d.filtered_records[0]['wodby']['node_name'])
31
+ assert_equal('node', d.filtered_records[1]['wodby']['node_name'])
30
32
  assert_nil(d.filtered_records[2]['wodby']['instance_query'])
33
+ assert_nil(d.filtered_records[2]['wodby.node_name'])
31
34
  assert_true(d.filtered_records[0]['wodby']['filter'])
32
35
  assert_true(d.filtered_records[1]['wodby']['filter'])
33
36
  assert_true(d.filtered_records[2]['wodby']['filter'])
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.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robert Wunderer