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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b96490cab3f0224d382d1654278df9aae7f1f9f6
|
4
|
+
data.tar.gz: 298dceba3b3c8570ed6d0ad91253672be7f4aeab
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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-
|
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
|
-
|
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.
|
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-
|
11
|
+
date: 2017-09-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fluentd
|