fluent-plugin-kubernetes_metadata_filter 0.11.0 → 0.12.0

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: 4e0fcd32fc3504d09147c16350c4596822151394
4
- data.tar.gz: d6032d7ec7cd42cf46fcf101e3d8579883502caf
3
+ metadata.gz: 9a693d1d4eda7b6f2243e7be4852cb0d158a5aba
4
+ data.tar.gz: d9d6d6ef27bf420eb20f6abbfcb254452b39b983
5
5
  SHA512:
6
- metadata.gz: 606ac89791ceec0de9f1f46d80ced6b126dff9325513c1bc177dcb1cb7f35896f9cdedea4a9aff657f5b0eab1569b0a0eb0143c38c51678cc86cbc5d47c6e1e7
7
- data.tar.gz: 98c9aa0d292a7dc9d679ab46961136986ecfbfcfdd2c9276ded1bca00c67fa6ca11a52581942ff3a3d10c32267b259d0267efc0db462f2d8331454f3af6f869c
6
+ metadata.gz: ca3e4278a6394318a7a0cb840da1820502d5eeca95339d4968ad25fb19c55b78c4bdbee16b6854293740af8a2ac01c9777546452750681e23d25df0caee7d0f6
7
+ data.tar.gz: 1e6038a0ff64a556ecc2dfac8c693ec4ec2cd1040d905414bb3c1dc2b11ba36a8cdd1a1c28f2843224815e7f9d5d6cf9459076f32c9d158f3a8babdf2f557ff2
@@ -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-kubernetes_metadata_filter"
7
- gem.version = "0.11.0"
7
+ gem.version = "0.12.0"
8
8
  gem.authors = ["Jimmi Dyson"]
9
9
  gem.email = ["jimmidyson@gmail.com"]
10
10
  gem.description = %q{Filter plugin to add Kubernetes metadata}
@@ -31,7 +31,7 @@ module Fluent
31
31
  config_param :verify_ssl, :bool, default: true
32
32
  config_param :tag_to_kubernetes_name_regexp,
33
33
  :string,
34
- :default => '\.(?<pod_name>[^\._]+)_(?<namespace>[^_]+)_(?<container_name>.+)-(?<docker_id>[a-z0-9]{64})\.log$'
34
+ :default => 'var\.log\.containers\.(?<pod_name>[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*)_(?<namespace>[^_]+)_(?<container_name>.+)-(?<docker_id>[a-z0-9]{64})\.log$'
35
35
  config_param :bearer_token_file, :string, default: ''
36
36
  config_param :merge_json_log, :bool, default: true
37
37
  config_param :include_namespace_id, :bool, default: false
@@ -112,8 +112,8 @@ class KubernetesMetadataFilterTest < Test::Unit::TestCase
112
112
  host: 'jimmi-redhat.localnet',
113
113
  pod_name: 'fabric8-console-controller-98rqc',
114
114
  container_name: 'fabric8-console-container',
115
- namespace_name: 'default',
116
- pod_id: 'c76927af-f563-11e4-b32d-54ee7527188d',
115
+ namespace_name: 'default',
116
+ pod_id: 'c76927af-f563-11e4-b32d-54ee7527188d',
117
117
  labels: {
118
118
  component: 'fabric8Console'
119
119
  }
@@ -167,8 +167,8 @@ class KubernetesMetadataFilterTest < Test::Unit::TestCase
167
167
  host: 'jimmi-redhat.localnet',
168
168
  pod_name: 'fabric8-console-controller-98rqc',
169
169
  container_name: 'fabric8-console-container',
170
- namespace_name: 'default',
171
- pod_id: 'c76927af-f563-11e4-b32d-54ee7527188d',
170
+ namespace_name: 'default',
171
+ pod_id: 'c76927af-f563-11e4-b32d-54ee7527188d',
172
172
  labels: {
173
173
  component: 'fabric8Console'
174
174
  }
@@ -187,7 +187,7 @@ class KubernetesMetadataFilterTest < Test::Unit::TestCase
187
187
  kubernetes: {
188
188
  pod_name: 'fabric8-console-controller-98rqc',
189
189
  container_name: 'fabric8-console-container',
190
- namespace_name: 'default',
190
+ namespace_name: 'default',
191
191
  }
192
192
  }
193
193
  assert_equal(expected_kube_metadata, es.instance_variable_get(:@record_array)[0])
@@ -208,7 +208,28 @@ class KubernetesMetadataFilterTest < Test::Unit::TestCase
208
208
  kubernetes: {
209
209
  pod_name: 'fabric8-console-controller-98rqc',
210
210
  container_name: 'fabric8-console-container',
211
- namespace_name: 'default'
211
+ namespace_name: 'default'
212
+ }
213
+ }
214
+ assert_equal(expected_kube_metadata, es.instance_variable_get(:@record_array)[0])
215
+ end
216
+
217
+ test 'with dot in pod name' do
218
+ stub_request(:any, 'https://localhost:8443/api').to_return(
219
+ body: {
220
+ versions: ['v1beta3', 'v1']
221
+ }.to_json
222
+ )
223
+ stub_request(:any, 'https://localhost:8443/api/v1/namespaces/default/pods/fabric8-console-controller.98rqc').to_timeout
224
+ es = emit_with_tag('var.log.containers.fabric8-console-controller.98rqc_default_fabric8-console-container-49095a2894da899d3b327c5fde1e056a81376cc9a8f8b09a195f2a92bceed459.log', {}, '')
225
+ expected_kube_metadata = {
226
+ docker: {
227
+ container_id: '49095a2894da899d3b327c5fde1e056a81376cc9a8f8b09a195f2a92bceed459'
228
+ },
229
+ kubernetes: {
230
+ pod_name: 'fabric8-console-controller.98rqc',
231
+ container_name: 'fabric8-console-container',
232
+ namespace_name: 'default'
212
233
  }
213
234
  }
214
235
  assert_equal(expected_kube_metadata, es.instance_variable_get(:@record_array)[0])
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-kubernetes_metadata_filter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.0
4
+ version: 0.12.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jimmi Dyson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-09-09 00:00:00.000000000 Z
11
+ date: 2015-09-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fluentd