fluentd 1.12.0 → 1.12.1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of fluentd might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/.github/workflows/build.yaml +29 -0
- data/CHANGELOG.md +27 -2
- data/README.md +1 -1
- data/fluentd.gemspec +1 -2
- data/lib/fluent/command/ca_generate.rb +6 -3
- data/lib/fluent/command/fluentd.rb +4 -0
- data/lib/fluent/command/plugin_config_formatter.rb +15 -1
- data/lib/fluent/config/section.rb +1 -1
- data/lib/fluent/plugin/out_http.rb +9 -2
- data/lib/fluent/supervisor.rb +12 -4
- data/lib/fluent/system_config.rb +2 -1
- data/lib/fluent/version.rb +1 -1
- data/templates/plugin_config_formatter/param.md-table.erb +10 -0
- data/test/command/test_fluentd.rb +30 -0
- data/test/command/test_plugin_config_formatter.rb +67 -0
- data/test/plugin/in_tail/test_position_file.rb +1 -1
- data/test/plugin/test_out_http.rb +19 -0
- data/test/plugin/test_sd_file.rb +1 -1
- data/test/plugin_helper/test_http_server_helper.rb +3 -1
- data/test/plugin_helper/test_server.rb +18 -5
- data/test/test_supervisor.rb +31 -0
- metadata +8 -25
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 04be4b818522c222348ba309bccd34f03d0aa79bfc2fbd21f2ce738677d7a5e5
|
4
|
+
data.tar.gz: '078ce4c3003b74be7356367ff81d96d910a5df322ebe2319d96120cb1e2898b3'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 77298246f6064ddf342765c37efb269236025566b33828cac9c88d69b6dabbbd2881c28ddae699d4620817a44a77310e15c4ac191a0ad51b6aeab51eb7442961
|
7
|
+
data.tar.gz: 318668fa9fde451292fd3b4284fc513124e6aa29218388a8a7cdfaaeb3943b3d3c4ffa45041cb0b2487da6573a9818f225c81b8769b7c025342bc5a6b5b05b53
|
@@ -0,0 +1,29 @@
|
|
1
|
+
name: build
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
branches: [master]
|
6
|
+
pull_request:
|
7
|
+
branches: [master]
|
8
|
+
|
9
|
+
jobs:
|
10
|
+
test:
|
11
|
+
runs-on: ubuntu-latest
|
12
|
+
|
13
|
+
strategy:
|
14
|
+
fail-fast: false
|
15
|
+
matrix:
|
16
|
+
ruby-version: [2.7, 2.6, 2.5]
|
17
|
+
|
18
|
+
steps:
|
19
|
+
- uses: actions/checkout@v2
|
20
|
+
- name: Set up Ruby
|
21
|
+
uses: ruby/setup-ruby@v1
|
22
|
+
with:
|
23
|
+
ruby-version: ${{ matrix.ruby-version }}
|
24
|
+
- name: Install addons
|
25
|
+
run: sudo apt-get install libgmp3-dev libcap-ng-dev
|
26
|
+
- name: Install dependencies
|
27
|
+
run: bundle install
|
28
|
+
- name: Run tests
|
29
|
+
run: bundle exec rake test TESTOPTS=-v
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,31 @@
|
|
1
1
|
# v1.12
|
2
2
|
|
3
|
-
## Release v1.12.
|
3
|
+
## Release v1.12.1 - 2021/02/18
|
4
|
+
|
5
|
+
### Enhancement
|
6
|
+
|
7
|
+
* out_http: Add `headers_from_placeholders` parameter
|
8
|
+
https://github.com/fluent/fluentd/pull/3241
|
9
|
+
* fluent-plugin-config-format: Add `--table` option to use markdown table
|
10
|
+
https://github.com/fluent/fluentd/pull/3240
|
11
|
+
* Add `--disable-shared-socket`/`disable_shared_socket` to disable ServerEngine's shared socket setup
|
12
|
+
https://github.com/fluent/fluentd/pull/3250
|
13
|
+
|
14
|
+
### Bug fix
|
15
|
+
|
16
|
+
* ca_generate: Fix creating TLS certification files which include broken extensions
|
17
|
+
https://github.com/fluent/fluentd/pull/3246
|
18
|
+
* test: Drop TLS 1.1 tests
|
19
|
+
https://github.com/fluent/fluentd/pull/3256
|
20
|
+
* Remove old gem constraints to support Ruby 3
|
21
|
+
|
22
|
+
### Misc
|
23
|
+
|
24
|
+
* Use GitHub Actions
|
25
|
+
https://github.com/fluent/fluentd/pull/3233
|
26
|
+
https://github.com/fluent/fluentd/pull/3255
|
27
|
+
|
28
|
+
## Release v1.12.0 - 2021/01/05
|
4
29
|
|
5
30
|
### New feature
|
6
31
|
|
@@ -14,7 +39,7 @@
|
|
14
39
|
|
15
40
|
### Enhancement
|
16
41
|
|
17
|
-
* buffer: Enable metadata comparison optimization on all
|
42
|
+
* buffer: Enable metadata comparison optimization on all platforms
|
18
43
|
https://github.com/fluent/fluentd/pull/3095
|
19
44
|
* fluent-plugin-config-formatter: Handle `service_discovery` type
|
20
45
|
https://github.com/fluent/fluentd/pull/3178
|
data/README.md
CHANGED
@@ -78,7 +78,7 @@ You can run specified test via `TEST` environment variable:
|
|
78
78
|
- Slack / Community: https://slack.fluentd.org
|
79
79
|
- Newsletters: https://www.fluentd.org/newsletter
|
80
80
|
- Author: [Sadayuki Furuhashi](https://github.com/frsyuki)
|
81
|
-
- Copyright: 2011-
|
81
|
+
- Copyright: 2011-2021 Fluentd Authors
|
82
82
|
- License: Apache License, Version 2.0
|
83
83
|
|
84
84
|
## Security
|
data/fluentd.gemspec
CHANGED
@@ -49,6 +49,5 @@ Gem::Specification.new do |gem|
|
|
49
49
|
gem.add_development_dependency("test-unit", ["~> 3.3"])
|
50
50
|
gem.add_development_dependency("test-unit-rr", ["~> 1.0"])
|
51
51
|
gem.add_development_dependency("oj", [">= 2.14", "< 4"])
|
52
|
-
gem.add_development_dependency("
|
53
|
-
gem.add_development_dependency("async-http")
|
52
|
+
gem.add_development_dependency("async-http", ">= 0.50.0")
|
54
53
|
end
|
@@ -75,6 +75,8 @@ HELP
|
|
75
75
|
|
76
76
|
digest = OpenSSL::Digest::SHA256.new
|
77
77
|
|
78
|
+
factory = OpenSSL::X509::ExtensionFactory.new
|
79
|
+
|
78
80
|
cert = OpenSSL::X509::Certificate.new
|
79
81
|
cert.not_before = Time.at(0)
|
80
82
|
cert.not_after = Time.now + 5 * 365 * 86400 # 5 years after
|
@@ -82,7 +84,7 @@ HELP
|
|
82
84
|
cert.serial = 1
|
83
85
|
cert.issuer = issuer
|
84
86
|
cert.subject = subject
|
85
|
-
cert.add_extension
|
87
|
+
cert.add_extension(factory.create_extension('basicConstraints', 'CA:TRUE'))
|
86
88
|
cert.sign(key, digest)
|
87
89
|
|
88
90
|
return cert, key
|
@@ -111,8 +113,9 @@ HELP
|
|
111
113
|
cert.issuer = issuer
|
112
114
|
cert.subject = subject
|
113
115
|
|
114
|
-
|
115
|
-
|
116
|
+
factory = OpenSSL::X509::ExtensionFactory.new
|
117
|
+
server_cert.add_extension(factory.create_extension('basicConstraints', 'CA:FALSE'))
|
118
|
+
server_cert.add_extension(factory.create_extension('nsCertType', 'server'))
|
116
119
|
|
117
120
|
cert.sign ca_key, digest
|
118
121
|
|
@@ -163,6 +163,10 @@ op.on('--conf-encoding ENCODING', "specify configuration file encoding") { |s|
|
|
163
163
|
opts[:conf_encoding] = s
|
164
164
|
}
|
165
165
|
|
166
|
+
op.on('--disable-shared-socket', "Don't open shared socket for multiple workers") { |b|
|
167
|
+
opts[:disable_shared_socket] = b
|
168
|
+
}
|
169
|
+
|
166
170
|
if Fluent.windows?
|
167
171
|
require 'windows/library'
|
168
172
|
include Windows::Library
|
@@ -162,9 +162,20 @@ class FluentPluginConfigFormatter
|
|
162
162
|
else
|
163
163
|
sections, params = base_section.partition {|_name, value| value[:section] }
|
164
164
|
end
|
165
|
+
if @table and not params.empty?
|
166
|
+
dumped << "### Configuration\n\n"
|
167
|
+
dumped << "|parameter|type|description|default|\n"
|
168
|
+
dumped << "|---|---|---|---|\n"
|
169
|
+
end
|
165
170
|
params.each do |name, config|
|
166
171
|
next if name == :section
|
167
|
-
template_name = @compact
|
172
|
+
template_name = if @compact
|
173
|
+
"param.md-compact.erb"
|
174
|
+
elsif @table
|
175
|
+
"param.md-table.erb"
|
176
|
+
else
|
177
|
+
"param.md.erb"
|
178
|
+
end
|
168
179
|
template = template_path(template_name).read
|
169
180
|
dumped <<
|
170
181
|
if ERB.instance_method(:initialize).parameters.assoc(:key) # Ruby 2.6+
|
@@ -257,6 +268,9 @@ BANNER
|
|
257
268
|
@parser.on("-p", "--plugin=DIR", "Add plugin directory") do |s|
|
258
269
|
@plugin_dirs << s
|
259
270
|
end
|
271
|
+
@parser.on("-t", "--table", "Use table syntax to dump parameters") do
|
272
|
+
@table = true
|
273
|
+
end
|
260
274
|
end
|
261
275
|
|
262
276
|
def parse_options!
|
@@ -247,7 +247,7 @@ module Fluent
|
|
247
247
|
def self.check_unused_section(proxy, conf, plugin_class)
|
248
248
|
elems = conf.respond_to?(:elements) ? conf.elements : []
|
249
249
|
elems.each { |e|
|
250
|
-
next if plugin_class.nil? && Fluent::Config::V1Parser::ELEM_SYMBOLS.include?(e.name) # skip pre-defined non-plugin elements because it
|
250
|
+
next if plugin_class.nil? && Fluent::Config::V1Parser::ELEM_SYMBOLS.include?(e.name) # skip pre-defined non-plugin elements because it doesn't have proxy section
|
251
251
|
next if e.unused_in && e.unused_in.empty? # the section is used at least once
|
252
252
|
|
253
253
|
if proxy.sections.any? { |name, subproxy| e.name == subproxy.name.to_s || e.name == subproxy.alias.to_s }
|
@@ -51,6 +51,8 @@ module Fluent::Plugin
|
|
51
51
|
config_param :json_array, :bool, default: false
|
52
52
|
desc 'Additional headers for HTTP request'
|
53
53
|
config_param :headers, :hash, default: nil
|
54
|
+
desc 'Additional placeholder based headers for HTTP request'
|
55
|
+
config_param :headers_from_placeholders, :hash, default: nil
|
54
56
|
|
55
57
|
desc 'The connection open timeout in seconds'
|
56
58
|
config_param :open_timeout, :integer, default: nil
|
@@ -213,12 +215,17 @@ module Fluent::Plugin
|
|
213
215
|
URI.parse(endpoint)
|
214
216
|
end
|
215
217
|
|
216
|
-
def set_headers(req)
|
218
|
+
def set_headers(req, chunk)
|
217
219
|
if @headers
|
218
220
|
@headers.each do |k, v|
|
219
221
|
req[k] = v
|
220
222
|
end
|
221
223
|
end
|
224
|
+
if @headers_from_placeholders
|
225
|
+
@headers_from_placeholders.each do |k, v|
|
226
|
+
req[k] = extract_placeholders(v, chunk)
|
227
|
+
end
|
228
|
+
end
|
222
229
|
req['Content-Type'] = @content_type
|
223
230
|
end
|
224
231
|
|
@@ -232,7 +239,7 @@ module Fluent::Plugin
|
|
232
239
|
if @auth
|
233
240
|
req.basic_auth(@auth.username, @auth.password)
|
234
241
|
end
|
235
|
-
set_headers(req)
|
242
|
+
set_headers(req, chunk)
|
236
243
|
req.body = @json_array ? "[#{chunk.read.chop}]" : chunk.read
|
237
244
|
req
|
238
245
|
end
|
data/lib/fluent/supervisor.rb
CHANGED
@@ -45,6 +45,7 @@ module Fluent
|
|
45
45
|
module ServerModule
|
46
46
|
def before_run
|
47
47
|
@fluentd_conf = config[:fluentd_conf]
|
48
|
+
@rpc_endpoint = nil
|
48
49
|
@rpc_server = nil
|
49
50
|
@counter = nil
|
50
51
|
|
@@ -64,9 +65,13 @@ module Fluent
|
|
64
65
|
run_counter_server(counter)
|
65
66
|
end
|
66
67
|
|
67
|
-
|
68
|
-
|
69
|
-
|
68
|
+
if config[:disable_shared_socket]
|
69
|
+
$log.info "shared socket for multiple workers is disabled"
|
70
|
+
else
|
71
|
+
socket_manager_path = ServerEngine::SocketManager::Server.generate_path
|
72
|
+
ServerEngine::SocketManager::Server.open(socket_manager_path)
|
73
|
+
ENV['SERVERENGINE_SOCKETMANAGER_PATH'] = socket_manager_path.to_s
|
74
|
+
end
|
70
75
|
end
|
71
76
|
|
72
77
|
def after_run
|
@@ -452,6 +457,7 @@ module Fluent
|
|
452
457
|
config_path: path,
|
453
458
|
main_cmd: params['main_cmd'],
|
454
459
|
signame: params['signame'],
|
460
|
+
disable_shared_socket: params['disable_shared_socket']
|
455
461
|
}
|
456
462
|
if daemonize
|
457
463
|
se_config[:pid_path] = pid_path
|
@@ -567,7 +573,8 @@ module Fluent
|
|
567
573
|
supervise: true,
|
568
574
|
standalone_worker: false,
|
569
575
|
signame: nil,
|
570
|
-
conf_encoding: 'utf-8'
|
576
|
+
conf_encoding: 'utf-8',
|
577
|
+
disable_shared_socket: nil
|
571
578
|
}
|
572
579
|
end
|
573
580
|
|
@@ -795,6 +802,7 @@ module Fluent
|
|
795
802
|
'counter_server' => @system_config.counter_server,
|
796
803
|
'log_format' => @system_config.log.format,
|
797
804
|
'log_time_format' => @system_config.log.time_format,
|
805
|
+
'disable_shared_socket' => @system_config.disable_shared_socket
|
798
806
|
}
|
799
807
|
|
800
808
|
se = ServerEngine.create(ServerModule, WorkerModule){
|
data/lib/fluent/system_config.rb
CHANGED
@@ -27,7 +27,7 @@ module Fluent
|
|
27
27
|
:log_event_verbose, :ignore_repeated_log_interval, :ignore_same_log_interval,
|
28
28
|
:without_source, :rpc_endpoint, :enable_get_dump, :process_name,
|
29
29
|
:file_permission, :dir_permission, :counter_server, :counter_client,
|
30
|
-
:strict_config_value, :enable_msgpack_time_support
|
30
|
+
:strict_config_value, :enable_msgpack_time_support, :disable_shared_socket
|
31
31
|
]
|
32
32
|
|
33
33
|
config_param :workers, :integer, default: 1
|
@@ -45,6 +45,7 @@ module Fluent
|
|
45
45
|
config_param :process_name, :string, default: nil
|
46
46
|
config_param :strict_config_value, :bool, default: nil
|
47
47
|
config_param :enable_msgpack_time_support, :bool, default: nil
|
48
|
+
config_param :disable_shared_socket, :bool, default: nil
|
48
49
|
config_param :file_permission, default: nil do |v|
|
49
50
|
v.to_i(8)
|
50
51
|
end
|
data/lib/fluent/version.rb
CHANGED
@@ -0,0 +1,10 @@
|
|
1
|
+
<%-
|
2
|
+
type = config[:type]
|
3
|
+
required_label = config[:required] ? "required" : "optional"
|
4
|
+
default = config[:default]
|
5
|
+
alias_name = config[:alias]
|
6
|
+
deprecated = config[:deprecated]
|
7
|
+
obsoleted = config[:obsoleted]
|
8
|
+
description = config[:desc]
|
9
|
+
-%>
|
10
|
+
|<%= name %>|<%= type %> (<%= required_label %>)|<%= description %><%- if type == :enum -%> (<%= config[:list].map{|x| "`#{x}`"}.join(", ") %>)<%- end -%><%- if alias_name -%><br>Alias: <%= alias_name %><%- end -%><%- if deprecated -%><br>Deprecated: <%= deprecated %><%- end -%><%- if obsoleted -%><br>Obsoleted: <%= :obsoleted %><%- end -%>|<%- if default -%>`<%= default %>`<%- end -%>|
|
@@ -1065,4 +1065,34 @@ CONF
|
|
1065
1065
|
"secret xxxxxx", patterns_not_match: ["secret secret0", "secret secret1"])
|
1066
1066
|
end
|
1067
1067
|
end
|
1068
|
+
|
1069
|
+
sub_test_case 'sahred socket options' do
|
1070
|
+
test 'enable shared socket by default' do
|
1071
|
+
conf = ""
|
1072
|
+
conf_path = create_conf_file('empty.conf', conf)
|
1073
|
+
assert File.exist?(conf_path)
|
1074
|
+
assert_log_matches(create_cmdline(conf_path),
|
1075
|
+
patterns_not_match: ["shared socket for multiple workers is disabled"])
|
1076
|
+
end
|
1077
|
+
|
1078
|
+
test 'disable shared socket by command line option' do
|
1079
|
+
conf = ""
|
1080
|
+
conf_path = create_conf_file('empty.conf', conf)
|
1081
|
+
assert File.exist?(conf_path)
|
1082
|
+
assert_log_matches(create_cmdline(conf_path, "--disable-shared-socket"),
|
1083
|
+
"shared socket for multiple workers is disabled",)
|
1084
|
+
end
|
1085
|
+
|
1086
|
+
test 'disable shared socket by system config' do
|
1087
|
+
conf = <<CONF
|
1088
|
+
<system>
|
1089
|
+
disable_shared_socket
|
1090
|
+
</system>
|
1091
|
+
CONF
|
1092
|
+
conf_path = create_conf_file('empty.conf', conf)
|
1093
|
+
assert File.exist?(conf_path)
|
1094
|
+
assert_log_matches(create_cmdline(conf_path, "--disable-shared-socket"),
|
1095
|
+
"shared socket for multiple workers is disabled",)
|
1096
|
+
end
|
1097
|
+
end
|
1068
1098
|
end
|
@@ -225,6 +225,30 @@ TEXT
|
|
225
225
|
path to something
|
226
226
|
|
227
227
|
|
228
|
+
TEXT
|
229
|
+
assert_equal(expected, dumped_config)
|
230
|
+
end
|
231
|
+
|
232
|
+
test "input simple (table)" do
|
233
|
+
dumped_config = capture_stdout do
|
234
|
+
FluentPluginConfigFormatter.new(["--format=markdown", "--table", "input", "simple"]).call
|
235
|
+
end
|
236
|
+
expected = <<TEXT
|
237
|
+
## Plugin helpers
|
238
|
+
|
239
|
+
* [inject](https://docs.fluentd.org/v/1.0/plugin-helper-overview/api-plugin-helper-inject)
|
240
|
+
* [compat_parameters](https://docs.fluentd.org/v/1.0/plugin-helper-overview/api-plugin-helper-compat_parameters)
|
241
|
+
|
242
|
+
* See also: [Input Plugin Overview](https://docs.fluentd.org/v/1.0/input#overview)
|
243
|
+
|
244
|
+
## TestFluentPluginConfigFormatter::SimpleInput
|
245
|
+
|
246
|
+
### Configuration
|
247
|
+
|
248
|
+
|parameter|type|description|default|
|
249
|
+
|---|---|---|---|
|
250
|
+
|path|string (required)|path to something||
|
251
|
+
|
228
252
|
TEXT
|
229
253
|
assert_equal(expected, dumped_config)
|
230
254
|
end
|
@@ -298,6 +322,49 @@ Default value: `normal`.
|
|
298
322
|
|
299
323
|
|
300
324
|
|
325
|
+
TEXT
|
326
|
+
assert_equal(expected, dumped_config)
|
327
|
+
end
|
328
|
+
|
329
|
+
test "output complex (table)" do
|
330
|
+
dumped_config = capture_stdout do
|
331
|
+
FluentPluginConfigFormatter.new(["--format=markdown", "--table", "output", "complex"]).call
|
332
|
+
end
|
333
|
+
expected = <<TEXT
|
334
|
+
## Plugin helpers
|
335
|
+
|
336
|
+
* [inject](https://docs.fluentd.org/v/1.0/plugin-helper-overview/api-plugin-helper-inject)
|
337
|
+
* [compat_parameters](https://docs.fluentd.org/v/1.0/plugin-helper-overview/api-plugin-helper-compat_parameters)
|
338
|
+
|
339
|
+
* See also: [Output Plugin Overview](https://docs.fluentd.org/v/1.0/output#overview)
|
340
|
+
|
341
|
+
## TestFluentPluginConfigFormatter::ComplexOutput
|
342
|
+
|
343
|
+
|
344
|
+
### \\<authentication\\> section (required) (single)
|
345
|
+
|
346
|
+
### Configuration
|
347
|
+
|
348
|
+
|parameter|type|description|default|
|
349
|
+
|---|---|---|---|
|
350
|
+
|username|string (required)|username||
|
351
|
+
|password|string (required)|password||
|
352
|
+
|
353
|
+
|
354
|
+
### \\<parent\\> section (optional) (multiple)
|
355
|
+
|
356
|
+
|
357
|
+
#### \\<child\\> section (optional) (multiple)
|
358
|
+
|
359
|
+
### Configuration
|
360
|
+
|
361
|
+
|parameter|type|description|default|
|
362
|
+
|---|---|---|---|
|
363
|
+
|names|array (required)|names||
|
364
|
+
|difficulty|enum (optional)|difficulty (`easy`, `normal`, `hard`)|`normal`|
|
365
|
+
|
366
|
+
|
367
|
+
|
301
368
|
TEXT
|
302
369
|
assert_equal(expected, dumped_config)
|
303
370
|
end
|
@@ -85,7 +85,7 @@ class IntailPositionFileTest < Test::Unit::TestCase
|
|
85
85
|
assert_equal 5, lines.size
|
86
86
|
end
|
87
87
|
|
88
|
-
test 'update seek
|
88
|
+
test 'update seek position of remained position entry' do
|
89
89
|
pf = Fluent::Plugin::TailInput::PositionFile.new(@file, false, {}, **{logger: $log})
|
90
90
|
target_info1 = Fluent::Plugin::TailInput::TargetInfo.new('path1', -1)
|
91
91
|
target_info2 = Fluent::Plugin::TailInput::TargetInfo.new('path2', -1)
|
@@ -280,6 +280,25 @@ class HTTPOutputTest < Test::Unit::TestCase
|
|
280
280
|
assert_equal "fluentd!", result.headers['test_header']
|
281
281
|
end
|
282
282
|
|
283
|
+
def test_write_with_headers_from_placeholders
|
284
|
+
d = create_driver(config + %[
|
285
|
+
headers_from_placeholders {"x-test":"${$.foo.bar}-test","x-tag":"${tag}"}
|
286
|
+
<buffer tag,$.foo.bar>
|
287
|
+
</buffer>
|
288
|
+
])
|
289
|
+
d.run(default_tag: 'test.http') do
|
290
|
+
test_events.each { |event|
|
291
|
+
ev = event.dup
|
292
|
+
ev['foo'] = {'bar' => 'abcd'}
|
293
|
+
d.feed(ev)
|
294
|
+
}
|
295
|
+
end
|
296
|
+
|
297
|
+
result = @@result
|
298
|
+
assert_equal "abcd-test", result.headers['x-test']
|
299
|
+
assert_equal "test.http", result.headers['x-tag']
|
300
|
+
end
|
301
|
+
|
283
302
|
def test_write_with_retryable_response
|
284
303
|
old_report_on_exception = Thread.report_on_exception
|
285
304
|
Thread.report_on_exception = false # thread finished as invalid state since RetryableResponse raises.
|
data/test/plugin/test_sd_file.rb
CHANGED
@@ -149,7 +149,7 @@ class FileServiceDiscoveryTest < ::Test::Unit::TestCase
|
|
149
149
|
assert_empty queue
|
150
150
|
end
|
151
151
|
|
152
|
-
test 'Skip if error is
|
152
|
+
test 'Skip if error is occurred' do
|
153
153
|
@sd_file.extend(TestStatEventHelperWrapper)
|
154
154
|
|
155
155
|
create_tmp_config('config.json', JSON.generate([{ port: 1233, host: '127.0.0.1' }]))
|
@@ -132,7 +132,9 @@ class HttpHelperTest < Test::Unit::TestCase
|
|
132
132
|
error = e
|
133
133
|
end
|
134
134
|
|
135
|
-
|
135
|
+
if response
|
136
|
+
resp = Response.new(response.status.to_s, response.body.read, response.headers)
|
137
|
+
end
|
136
138
|
end
|
137
139
|
|
138
140
|
if error
|
@@ -832,8 +832,9 @@ class ServerPluginHelperTest < Test::Unit::TestCase
|
|
832
832
|
chain_cert.sign(root_key, "sha256")
|
833
833
|
|
834
834
|
server_cert, server_key, _ = CertUtil.cert_option_generate_pair(create_server_options, chain_cert.subject)
|
835
|
-
|
836
|
-
server_cert.add_extension
|
835
|
+
factory = OpenSSL::X509::ExtensionFactory.new
|
836
|
+
server_cert.add_extension(factory.create_extension('basicConstraints', 'CA:FALSE'))
|
837
|
+
server_cert.add_extension(factory.create_extension('nsCertType', 'server'))
|
837
838
|
server_cert.sign(chain_key, "sha256")
|
838
839
|
|
839
840
|
# write chained cert
|
@@ -1494,8 +1495,13 @@ class ServerPluginHelperTest < Test::Unit::TestCase
|
|
1494
1495
|
test "can't connect with different TLS version" do
|
1495
1496
|
@d.server_create_tls(:s, PORT, tls_options: @tls_options) do |data, conn|
|
1496
1497
|
end
|
1498
|
+
if defined?(OpenSSL::SSL::TLS1_3_VERSION)
|
1499
|
+
version = :'TLS1_3'
|
1500
|
+
else
|
1501
|
+
version = :'TLS1_1'
|
1502
|
+
end
|
1497
1503
|
assert_raise(OpenSSL::SSL::SSLError, Errno::ECONNRESET) {
|
1498
|
-
open_tls_session('127.0.0.1', PORT, cert_path: @cert_path, version:
|
1504
|
+
open_tls_session('127.0.0.1', PORT, cert_path: @cert_path, version: version) do |sock|
|
1499
1505
|
end
|
1500
1506
|
}
|
1501
1507
|
end
|
@@ -1503,14 +1509,21 @@ class ServerPluginHelperTest < Test::Unit::TestCase
|
|
1503
1509
|
test "can specify multiple TLS versions by min_version/max_version" do
|
1504
1510
|
omit "min_version=/max_version= is not supported" unless Fluent::TLS::MIN_MAX_AVAILABLE
|
1505
1511
|
|
1506
|
-
|
1512
|
+
min_version = :'TLS1_2'
|
1513
|
+
if defined?(OpenSSL::SSL::TLS1_3_VERSION)
|
1514
|
+
max_version = :'TLS1_3'
|
1515
|
+
else
|
1516
|
+
max_version = :'TLS1_2'
|
1517
|
+
end
|
1518
|
+
|
1519
|
+
opts = @tls_options.merge(min_version: min_version, max_version: max_version)
|
1507
1520
|
@d.server_create_tls(:s, PORT, tls_options: opts) do |data, conn|
|
1508
1521
|
end
|
1509
1522
|
assert_raise(OpenSSL::SSL::SSLError, Errno::ECONNRESET) {
|
1510
1523
|
open_tls_session('127.0.0.1', PORT, cert_path: @cert_path, version: :'TLS1') do |sock|
|
1511
1524
|
end
|
1512
1525
|
}
|
1513
|
-
[
|
1526
|
+
[min_version, max_version].each { |ver|
|
1514
1527
|
assert_nothing_raised {
|
1515
1528
|
open_tls_session('127.0.0.1', PORT, cert_path: @cert_path, version: ver) do |sock|
|
1516
1529
|
end
|
data/test/test_supervisor.rb
CHANGED
@@ -517,6 +517,37 @@ class SupervisorTest < ::Test::Unit::TestCase
|
|
517
517
|
assert_equal Fluent::Log::LEVEL_ERROR, $log.level
|
518
518
|
end
|
519
519
|
|
520
|
+
def test_enable_shared_socket
|
521
|
+
server = DummyServer.new
|
522
|
+
begin
|
523
|
+
ENV.delete('SERVERENGINE_SOCKETMANAGER_PATH')
|
524
|
+
server.before_run
|
525
|
+
sleep 0.1 if Fluent.windows? # Wait for starting windows event thread
|
526
|
+
assert_not_nil(ENV['SERVERENGINE_SOCKETMANAGER_PATH'])
|
527
|
+
ensure
|
528
|
+
server.after_run
|
529
|
+
ENV.delete('SERVERENGINE_SOCKETMANAGER_PATH')
|
530
|
+
end
|
531
|
+
end
|
532
|
+
|
533
|
+
def test_disable_shared_socket
|
534
|
+
server = DummyServer.new
|
535
|
+
def server.config
|
536
|
+
{
|
537
|
+
:disable_shared_socket => true,
|
538
|
+
}
|
539
|
+
end
|
540
|
+
begin
|
541
|
+
ENV.delete('SERVERENGINE_SOCKETMANAGER_PATH')
|
542
|
+
server.before_run
|
543
|
+
sleep 0.1 if Fluent.windows? # Wait for starting windows event thread
|
544
|
+
assert_nil(ENV['SERVERENGINE_SOCKETMANAGER_PATH'])
|
545
|
+
ensure
|
546
|
+
server.after_run
|
547
|
+
ENV.delete('SERVERENGINE_SOCKETMANAGER_PATH')
|
548
|
+
end
|
549
|
+
end
|
550
|
+
|
520
551
|
def create_debug_dummy_logger
|
521
552
|
dl_opts = {}
|
522
553
|
dl_opts[:log_level] = ServerEngine::DaemonLogger::DEBUG
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluentd
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.12.
|
4
|
+
version: 1.12.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sadayuki Furuhashi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-02-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -318,40 +318,20 @@ dependencies:
|
|
318
318
|
- - "<"
|
319
319
|
- !ruby/object:Gem::Version
|
320
320
|
version: '4'
|
321
|
-
- !ruby/object:Gem::Dependency
|
322
|
-
name: ext_monitor
|
323
|
-
requirement: !ruby/object:Gem::Requirement
|
324
|
-
requirements:
|
325
|
-
- - ">="
|
326
|
-
- !ruby/object:Gem::Version
|
327
|
-
version: 0.1.2
|
328
|
-
- - "<"
|
329
|
-
- !ruby/object:Gem::Version
|
330
|
-
version: '0.2'
|
331
|
-
type: :development
|
332
|
-
prerelease: false
|
333
|
-
version_requirements: !ruby/object:Gem::Requirement
|
334
|
-
requirements:
|
335
|
-
- - ">="
|
336
|
-
- !ruby/object:Gem::Version
|
337
|
-
version: 0.1.2
|
338
|
-
- - "<"
|
339
|
-
- !ruby/object:Gem::Version
|
340
|
-
version: '0.2'
|
341
321
|
- !ruby/object:Gem::Dependency
|
342
322
|
name: async-http
|
343
323
|
requirement: !ruby/object:Gem::Requirement
|
344
324
|
requirements:
|
345
325
|
- - ">="
|
346
326
|
- !ruby/object:Gem::Version
|
347
|
-
version:
|
327
|
+
version: 0.50.0
|
348
328
|
type: :development
|
349
329
|
prerelease: false
|
350
330
|
version_requirements: !ruby/object:Gem::Requirement
|
351
331
|
requirements:
|
352
332
|
- - ">="
|
353
333
|
- !ruby/object:Gem::Version
|
354
|
-
version:
|
334
|
+
version: 0.50.0
|
355
335
|
description: Fluentd is an open source data collector designed to scale and simplify
|
356
336
|
log management. It can collect, process and ship many kinds of data in near real-time.
|
357
337
|
email:
|
@@ -376,6 +356,7 @@ files:
|
|
376
356
|
- ".github/ISSUE_TEMPLATE/config.yml"
|
377
357
|
- ".github/ISSUE_TEMPLATE/feature_request.md"
|
378
358
|
- ".github/PULL_REQUEST_TEMPLATE.md"
|
359
|
+
- ".github/workflows/build.yaml"
|
379
360
|
- ".github/workflows/issue-auto-closer.yml"
|
380
361
|
- ".github/workflows/stale-actions.yml"
|
381
362
|
- ".gitignore"
|
@@ -694,6 +675,7 @@ files:
|
|
694
675
|
- templates/new_gem/test/plugin/test_output.rb.erb
|
695
676
|
- templates/new_gem/test/plugin/test_parser.rb.erb
|
696
677
|
- templates/plugin_config_formatter/param.md-compact.erb
|
678
|
+
- templates/plugin_config_formatter/param.md-table.erb
|
697
679
|
- templates/plugin_config_formatter/param.md.erb
|
698
680
|
- templates/plugin_config_formatter/section.md.erb
|
699
681
|
- test/command/test_binlog_reader.rb
|
@@ -928,7 +910,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
928
910
|
- !ruby/object:Gem::Version
|
929
911
|
version: '0'
|
930
912
|
requirements: []
|
931
|
-
|
913
|
+
rubyforge_project:
|
914
|
+
rubygems_version: 2.7.6.2
|
932
915
|
signing_key:
|
933
916
|
specification_version: 4
|
934
917
|
summary: Fluentd event collector
|