fluent-plugin-docker_metadata_filter 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/Rakefile +1 -0
- data/fluent-plugin-docker_metadata_filter.gemspec +3 -2
- data/test/cassettes/nonexistent_docker_metadata.yml +115 -0
- data/test/helper.rb +9 -24
- data/test/plugin/test_filter_docker_metadata.rb +11 -3
- metadata +17 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5e3a181437b2dba81ddb5695afa2ff08a398fa4d
|
|
4
|
+
data.tar.gz: 200420bd81fde33e9db8d065c3d311ad1d08c366
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 48a43e9af6ea3d21bb99b4916f579da1a816c3d4f36f4be713b37dc0b4ca50c0877ae25bf2231914e520d9bd75e38d970768ffb39dc511a50cf31813c3d9ce24
|
|
7
|
+
data.tar.gz: f13a36c14e7963b0372a47846b7e97f72528d6954c11a51af9f7c2b87781c69b367443beb8aee7d17e3be7d304fbdb3d67e30f381967e250e5418d8cb3f4fc45
|
data/README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# fluent-plugin-docker_metadata_filter, a plugin for [Fluentd](http://fluentd.org)
|
|
2
|
-
[](https://circleci.com/gh/fabric8io/fluent-plugin-docker_metadata_filter)
|
|
2
|
+
[](https://circleci.com/gh/fabric8io/fluent-plugin-docker_metadata_filter)
|
|
3
3
|
[](https://codeclimate.com/github/fabric8io/fluent-plugin-docker_metadata_filter)
|
|
4
4
|
[](https://codeclimate.com/github/fabric8io/fluent-plugin-docker_metadata_filter)
|
|
5
5
|
|
data/Rakefile
CHANGED
|
@@ -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-docker_metadata_filter"
|
|
7
|
-
gem.version = "0.1.
|
|
7
|
+
gem.version = "0.1.1"
|
|
8
8
|
gem.authors = ["Jimmi Dyson"]
|
|
9
9
|
gem.email = ["jimmidyson@gmail.com"]
|
|
10
10
|
gem.description = %q{Filter plugin to add Docker metadata}
|
|
@@ -16,7 +16,7 @@ Gem::Specification.new do |gem|
|
|
|
16
16
|
gem.executables = gem.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
|
17
17
|
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
|
18
18
|
gem.require_paths = ["lib"]
|
|
19
|
-
gem.has_rdoc
|
|
19
|
+
gem.has_rdoc = false
|
|
20
20
|
|
|
21
21
|
gem.required_ruby_version = '>= 1.9.3'
|
|
22
22
|
|
|
@@ -32,4 +32,5 @@ Gem::Specification.new do |gem|
|
|
|
32
32
|
gem.add_development_dependency "copyright-header"
|
|
33
33
|
gem.add_development_dependency "webmock"
|
|
34
34
|
gem.add_development_dependency "vcr"
|
|
35
|
+
gem.add_development_dependency "bump"
|
|
35
36
|
end
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
---
|
|
2
|
+
http_interactions:
|
|
3
|
+
- request:
|
|
4
|
+
method: get
|
|
5
|
+
uri: http://unix/v1.16/containers/1111111111111111111111111111111111111111111111111111111111111111/json
|
|
6
|
+
body:
|
|
7
|
+
encoding: US-ASCII
|
|
8
|
+
string: ''
|
|
9
|
+
headers:
|
|
10
|
+
User-Agent:
|
|
11
|
+
- Swipely/Docker-API 1.21.4
|
|
12
|
+
Content-Type:
|
|
13
|
+
- text/plain
|
|
14
|
+
response:
|
|
15
|
+
status:
|
|
16
|
+
code: 404
|
|
17
|
+
message: ''
|
|
18
|
+
headers:
|
|
19
|
+
Content-Type:
|
|
20
|
+
- text/plain; charset=utf-8
|
|
21
|
+
Date:
|
|
22
|
+
- Thu, 07 May 2015 14:37:37 GMT
|
|
23
|
+
Content-Length:
|
|
24
|
+
- '77'
|
|
25
|
+
body:
|
|
26
|
+
encoding: UTF-8
|
|
27
|
+
string: |
|
|
28
|
+
no such id: 1111111111111111111111111111111111111111111111111111111111111111
|
|
29
|
+
http_version:
|
|
30
|
+
recorded_at: Thu, 07 May 2015 14:37:37 GMT
|
|
31
|
+
- request:
|
|
32
|
+
method: get
|
|
33
|
+
uri: http://unix/v1.16/containers/1111111111111111111111111111111111111111111111111111111111111111/json
|
|
34
|
+
body:
|
|
35
|
+
encoding: US-ASCII
|
|
36
|
+
string: ''
|
|
37
|
+
headers:
|
|
38
|
+
User-Agent:
|
|
39
|
+
- Swipely/Docker-API 1.21.4
|
|
40
|
+
Content-Type:
|
|
41
|
+
- text/plain
|
|
42
|
+
response:
|
|
43
|
+
status:
|
|
44
|
+
code: 404
|
|
45
|
+
message: ''
|
|
46
|
+
headers:
|
|
47
|
+
Content-Type:
|
|
48
|
+
- text/plain; charset=utf-8
|
|
49
|
+
Date:
|
|
50
|
+
- Thu, 07 May 2015 14:37:37 GMT
|
|
51
|
+
Content-Length:
|
|
52
|
+
- '77'
|
|
53
|
+
body:
|
|
54
|
+
encoding: UTF-8
|
|
55
|
+
string: |
|
|
56
|
+
no such id: 1111111111111111111111111111111111111111111111111111111111111111
|
|
57
|
+
http_version:
|
|
58
|
+
recorded_at: Thu, 07 May 2015 14:37:37 GMT
|
|
59
|
+
- request:
|
|
60
|
+
method: get
|
|
61
|
+
uri: http://unix/v1.16/containers/1111111111111111111111111111111111111111111111111111111111111111/json
|
|
62
|
+
body:
|
|
63
|
+
encoding: US-ASCII
|
|
64
|
+
string: ''
|
|
65
|
+
headers:
|
|
66
|
+
User-Agent:
|
|
67
|
+
- Swipely/Docker-API 1.21.4
|
|
68
|
+
Content-Type:
|
|
69
|
+
- text/plain
|
|
70
|
+
response:
|
|
71
|
+
status:
|
|
72
|
+
code: 404
|
|
73
|
+
message: ''
|
|
74
|
+
headers:
|
|
75
|
+
Content-Type:
|
|
76
|
+
- text/plain; charset=utf-8
|
|
77
|
+
Date:
|
|
78
|
+
- Thu, 07 May 2015 14:37:37 GMT
|
|
79
|
+
Content-Length:
|
|
80
|
+
- '77'
|
|
81
|
+
body:
|
|
82
|
+
encoding: UTF-8
|
|
83
|
+
string: |
|
|
84
|
+
no such id: 1111111111111111111111111111111111111111111111111111111111111111
|
|
85
|
+
http_version:
|
|
86
|
+
recorded_at: Thu, 07 May 2015 14:37:37 GMT
|
|
87
|
+
- request:
|
|
88
|
+
method: get
|
|
89
|
+
uri: http://unix/v1.16/containers/1111111111111111111111111111111111111111111111111111111111111111/json
|
|
90
|
+
body:
|
|
91
|
+
encoding: US-ASCII
|
|
92
|
+
string: ''
|
|
93
|
+
headers:
|
|
94
|
+
User-Agent:
|
|
95
|
+
- Swipely/Docker-API 1.21.4
|
|
96
|
+
Content-Type:
|
|
97
|
+
- text/plain
|
|
98
|
+
response:
|
|
99
|
+
status:
|
|
100
|
+
code: 404
|
|
101
|
+
message: ''
|
|
102
|
+
headers:
|
|
103
|
+
Content-Type:
|
|
104
|
+
- text/plain; charset=utf-8
|
|
105
|
+
Date:
|
|
106
|
+
- Thu, 07 May 2015 14:37:37 GMT
|
|
107
|
+
Content-Length:
|
|
108
|
+
- '77'
|
|
109
|
+
body:
|
|
110
|
+
encoding: UTF-8
|
|
111
|
+
string: |
|
|
112
|
+
no such id: 1111111111111111111111111111111111111111111111111111111111111111
|
|
113
|
+
http_version:
|
|
114
|
+
recorded_at: Thu, 07 May 2015 14:37:37 GMT
|
|
115
|
+
recorded_with: VCR 2.9.3
|
data/test/helper.rb
CHANGED
|
@@ -16,29 +16,13 @@
|
|
|
16
16
|
# See the License for the specific language governing permissions and
|
|
17
17
|
# limitations under the License.
|
|
18
18
|
#
|
|
19
|
-
#
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
m.instance_eval do
|
|
27
|
-
begin
|
|
28
|
-
initialize(*args, &block)
|
|
29
|
-
rescue Encoding::UndefinedConversionError
|
|
30
|
-
@src = "".force_encoding('UTF-8')
|
|
31
|
-
end
|
|
32
|
-
end
|
|
33
|
-
m
|
|
34
|
-
end
|
|
35
|
-
end
|
|
36
|
-
unless SimpleCov.running
|
|
37
|
-
SimpleCov.start do
|
|
38
|
-
add_filter '/test/'
|
|
39
|
-
add_filter '/gems/'
|
|
40
|
-
end
|
|
41
|
-
end
|
|
19
|
+
#
|
|
20
|
+
require "codeclimate-test-reporter"
|
|
21
|
+
SimpleCov.start do
|
|
22
|
+
formatter SimpleCov::Formatter::MultiFormatter[
|
|
23
|
+
SimpleCov::Formatter::HTMLFormatter,
|
|
24
|
+
CodeClimate::TestReporter::Formatter
|
|
25
|
+
]
|
|
42
26
|
end
|
|
43
27
|
|
|
44
28
|
require 'rr'
|
|
@@ -53,6 +37,7 @@ require 'vcr'
|
|
|
53
37
|
VCR.configure do |config|
|
|
54
38
|
config.cassette_library_dir = "test/cassettes"
|
|
55
39
|
config.hook_into :webmock # or :fakeweb
|
|
40
|
+
config.ignore_hosts 'codeclimate.com'
|
|
56
41
|
end
|
|
57
42
|
|
|
58
43
|
unless defined?(Test::Unit::AssertionFailedError)
|
|
@@ -78,4 +63,4 @@ def ipv6_enabled?
|
|
|
78
63
|
end
|
|
79
64
|
end
|
|
80
65
|
|
|
81
|
-
$log = Fluent::Log.new(Fluent::Test::DummyLogDevice.new, Fluent::Log::LEVEL_WARN)
|
|
66
|
+
$log = Fluent::Log.new(Fluent::Test::DummyLogDevice.new, Fluent::Log::LEVEL_WARN)
|
|
@@ -64,11 +64,11 @@ class DockerMetadataFilterTest < Test::Unit::TestCase
|
|
|
64
64
|
]
|
|
65
65
|
end
|
|
66
66
|
|
|
67
|
-
def emit(config, msgs)
|
|
67
|
+
def emit(config, msgs, tag='df14e0d5ae4c07284fa636d739c8fc2e6b52bc344658de7d3f08c36a2e804115')
|
|
68
68
|
d = create_driver(config)
|
|
69
69
|
d.run {
|
|
70
70
|
msgs.each { |msg|
|
|
71
|
-
d.emit_with_tag(
|
|
71
|
+
d.emit_with_tag(tag, {'foo' => 'bar', 'message' => msg}, @time)
|
|
72
72
|
}
|
|
73
73
|
}.filtered
|
|
74
74
|
end
|
|
@@ -84,5 +84,13 @@ class DockerMetadataFilterTest < Test::Unit::TestCase
|
|
|
84
84
|
assert_equal('fabric8/hawtio-kubernetes:latest', es.instance_variable_get(:@record_array)[0][:docker][:image])
|
|
85
85
|
end
|
|
86
86
|
end
|
|
87
|
+
|
|
88
|
+
test 'nonexistent docker metadata' do
|
|
89
|
+
VCR.use_cassette('nonexistent_docker_metadata') do
|
|
90
|
+
es = emit('', messages, '1111111111111111111111111111111111111111111111111111111111111111')
|
|
91
|
+
assert_equal(4, es.instance_variable_get(:@record_array).size)
|
|
92
|
+
assert_nil(es.instance_variable_get(:@record_array)[0][:docker])
|
|
93
|
+
end
|
|
94
|
+
end
|
|
87
95
|
end
|
|
88
|
-
end
|
|
96
|
+
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: fluent-plugin-docker_metadata_filter
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Jimmi Dyson
|
|
@@ -164,6 +164,20 @@ dependencies:
|
|
|
164
164
|
- - ">="
|
|
165
165
|
- !ruby/object:Gem::Version
|
|
166
166
|
version: '0'
|
|
167
|
+
- !ruby/object:Gem::Dependency
|
|
168
|
+
name: bump
|
|
169
|
+
requirement: !ruby/object:Gem::Requirement
|
|
170
|
+
requirements:
|
|
171
|
+
- - ">="
|
|
172
|
+
- !ruby/object:Gem::Version
|
|
173
|
+
version: '0'
|
|
174
|
+
type: :development
|
|
175
|
+
prerelease: false
|
|
176
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
177
|
+
requirements:
|
|
178
|
+
- - ">="
|
|
179
|
+
- !ruby/object:Gem::Version
|
|
180
|
+
version: '0'
|
|
167
181
|
description: Filter plugin to add Docker metadata
|
|
168
182
|
email:
|
|
169
183
|
- jimmidyson@gmail.com
|
|
@@ -180,6 +194,7 @@ files:
|
|
|
180
194
|
- fluent-plugin-docker_metadata_filter.gemspec
|
|
181
195
|
- lib/fluent/plugin/filter_docker_metadata.rb
|
|
182
196
|
- test/cassettes/docker_metadata.yml
|
|
197
|
+
- test/cassettes/nonexistent_docker_metadata.yml
|
|
183
198
|
- test/helper.rb
|
|
184
199
|
- test/plugin/test_filter_docker_metadata.rb
|
|
185
200
|
homepage: https://github.com/fabric8io/fluent-plugin-docker_metadata_filter
|
|
@@ -208,5 +223,6 @@ specification_version: 4
|
|
|
208
223
|
summary: Filter plugin to add Docker metadata
|
|
209
224
|
test_files:
|
|
210
225
|
- test/cassettes/docker_metadata.yml
|
|
226
|
+
- test/cassettes/nonexistent_docker_metadata.yml
|
|
211
227
|
- test/helper.rb
|
|
212
228
|
- test/plugin/test_filter_docker_metadata.rb
|