fluent-plugin-append-kubernetes-annotations-to-tag 0.1.0.pre.1 → 0.1.0.pre.2

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: d7da748021046796e906d6e1eb43d844971107b9
4
- data.tar.gz: d85c50c23f6560ce3be1f4dc16631472d8b1ae77
3
+ metadata.gz: b96490cab3f0224d382d1654278df9aae7f1f9f6
4
+ data.tar.gz: 298dceba3b3c8570ed6d0ad91253672be7f4aeab
5
5
  SHA512:
6
- metadata.gz: c1d30236ad109b5c844bf34e415fa52a2fc631b5f03bade55c1d9302cb5d0bd2a8364e4285419472a12efd37df8661f6473bff7c4f4bf974c3dacc85cdd1fdd8
7
- data.tar.gz: 171abf03699c64d26936566df4c89f32065f4f064847b147b3be8450886f6730c951a0235a1f236443082de36d625154b3354c8f344ac1b379a2e6a1a68c4dd8
6
+ metadata.gz: bc978fbad79ad05c4cb1db51837a35eceb7b8d813e1cdd8480c9ce98a4ef047fba56dec9f4d8e23d4bf5fc6ce1cd1c1ac4128f18c9148cd6dba355e7b5a8c324
7
+ data.tar.gz: 2684ec8c8a637ce8f3f593906674afee5cbc61ddc1876cea50711f60b62c0ef33fdd3ae337f31ec1f0cfb70f100d87108dd7a1b67aafc5815f3192bd2d4b908a
@@ -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.1.0-1"
7
+ gem.version = "0.1.0-2"
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}
@@ -1,3 +1,5 @@
1
+ require 'json'
2
+
1
3
  class KubernetesAnnotationsTagAppender
2
4
  attr_reader :annotations
3
5
 
@@ -7,7 +9,8 @@ class KubernetesAnnotationsTagAppender
7
9
 
8
10
  def append(tag, data, container_name)
9
11
  matches = annotations.select do | annotation |
10
- data[annotation]&.include? container_name
12
+ json = data[annotation] || "[]"
13
+ JSON.parse(json)&.include? container_name
11
14
  end
12
15
 
13
16
  return ([tag] + matches).join(".")
metadata CHANGED
@@ -1,14 +1,14 @@
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.1.0.pre.1
4
+ version: 0.1.0.pre.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Redbubble Delivery Engineering Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-09-27 00:00:00.000000000 Z
11
+ date: 2017-09-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fluentd