fluent-plugin-append-kubernetes-annotations-to-tag 0.0.1 → 0.1.0.pre.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
  SHA1:
3
- metadata.gz: 5a7d7bf1ee7d6e83c8498d8ed86d796b4492e084
4
- data.tar.gz: 5a20e6cb091a67753c4d6d20132f63781286b849
3
+ metadata.gz: d7da748021046796e906d6e1eb43d844971107b9
4
+ data.tar.gz: d85c50c23f6560ce3be1f4dc16631472d8b1ae77
5
5
  SHA512:
6
- metadata.gz: 2e690ee2964acd86afec3510050a84d2a848628115427022180b678f16e196cdb3dace67380fa57d52f8eea7cb9440e4979b62c19f07dc073c86c455ac2f9b8d
7
- data.tar.gz: fe6b96d2247791be76405b8633a49e7a3601eeb20211c3e1dc82e50cb99aba13024fb5f75e0b48b646a505829e32ecd694ec06b6a0cfdfe6faa01664c5b85e8f
6
+ metadata.gz: c1d30236ad109b5c844bf34e415fa52a2fc631b5f03bade55c1d9302cb5d0bd2a8364e4285419472a12efd37df8661f6473bff7c4f4bf974c3dacc85cdd1fdd8
7
+ data.tar.gz: 171abf03699c64d26936566df4c89f32065f4f064847b147b3be8450886f6730c951a0235a1f236443082de36d625154b3354c8f344ac1b379a2e6a1a68c4dd8
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |gem|
6
6
  gem.name = "fluent-plugin-append-kubernetes-annotations-to-tag"
7
- gem.version = "0.0.1"
7
+ gem.version = "0.1.0-1"
8
8
  gem.authors = ["Redbubble Delivery Engineering Team"]
9
9
  gem.email = ["delivery-engineers@redbubble.com"]
10
10
  gem.description = %q{Filter plugin to append certain Kubernetes annotations to the Fluentd tag}
@@ -36,8 +36,10 @@ module Fluent
36
36
  end
37
37
 
38
38
  def event(tag, time, record)
39
- new_tag = if record.has_key? 'kubernetes' && record['kubernetes'].has_key? 'annotations'
40
- kubernetes_annotations_tag_appender.append(tag, record['kubernetes']['annotations'])
39
+ new_tag = if record.has_key?('kubernetes') && record['kubernetes'].has_key?('annotations')
40
+ kubernetes_annotations_tag_appender.append(tag,
41
+ record['kubernetes']['annotations'],
42
+ record['kubernetes']['container_name'])
41
43
  else
42
44
  tag
43
45
  end
@@ -5,7 +5,11 @@ class KubernetesAnnotationsTagAppender
5
5
  @annotations = annotations
6
6
  end
7
7
 
8
- def append(tag, data)
9
- @annotations.reduce(tag) { |t, l| "#{t}.#{l}=#{data[l]}" }
8
+ def append(tag, data, container_name)
9
+ matches = annotations.select do | annotation |
10
+ data[annotation]&.include? container_name
11
+ end
12
+
13
+ return ([tag] + matches).join(".")
10
14
  end
11
15
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-append-kubernetes-annotations-to-tag
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.1.0.pre.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Redbubble Delivery Engineering Team
@@ -80,12 +80,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
80
80
  version: 2.0.0
81
81
  required_rubygems_version: !ruby/object:Gem::Requirement
82
82
  requirements:
83
- - - ">="
83
+ - - ">"
84
84
  - !ruby/object:Gem::Version
85
- version: '0'
85
+ version: 1.3.1
86
86
  requirements: []
87
87
  rubyforge_project:
88
- rubygems_version: 2.6.13
88
+ rubygems_version: 2.5.1
89
89
  signing_key:
90
90
  specification_version: 4
91
91
  summary: Filter plugin to append certain Kubernetes annotations to the Fluentd tag