configuration reload fails when using "<<: !include" keyword in yaml configuration
- Dominant language
- Ruby
- Stars
- 13.6k
- Forks
- 1.4k
- Avg merge
- 1d 3h
- Merged PRs (30d)
- 20
Description
### Describe the bug
configuration reload fails when using "<<: !include" keyword in yaml configuration
### To Reproduce
use this configuration:
fluentd.yml
```
system:
enable_jit: true
config:
- source:
$type: sample
sample: '{"hello":"world"}'
auto_increment_key: foo_key
tag: sample
- match:
$type: stdout
<<: !include output.yml
```
output.yml
```
$tag: "**"
```
exec fluentd
```
$ fluentd -c fluentd.yml
2022-10-24 14:06:40 +0900 [info]: parsing config file is succeeded path="fluentd.yml"
2022-10-24 14:06:40 +0900 [info]: gem 'fluentd' version '1.15.2'
2022-10-24 14:06:40 +0900 [info]: Oj isn't installed, fallback to Yajl as json parser
2022-10-24 14:06:40 +0900 [warn]: both of Plugin @id and path for are not specified. Using on-memory store.
2022-10-24 14:06:40 +0900 [warn]: both of Plugin @id and path for are not specified. Using on-memory store.
2022-10-24 14:06:40 +0900 [warn]: define to capture fluentd logs in top level is deprecated. Use instead
2022-10-24 14:06:40 +0900 [info]: using configuration file:
enable_jit true
@type sample
sample {"hello":"world"}
auto_increment_key "foo_key"
tag "sample"
@type stdout
```
exec config reload by USR2 signal
$ kill -USR2 -p 970480
fluentd says
```
2022-10-24 14:06:46 +0900 [info]: Reloading new config
2022-10-24 14:06:46 +0900 [error]: Failed to reload config file: expected '>' at fluentd.yml line 11,30
10: $type: stdout
11: <<: !include output.yml
------------------------------^
```
### Expected behavior
The include keyword should be expanded as at startup
### Your Environment
```markdown
- Fluentd version:1.15.2
- Operating system:Ubuntu 22.04
- Kernel version:5.15.0-40
```
### Your Configuration
```apache
system:
enable_jit: true
config:
- source:
$type: sample
sample: '{"hello":"world"}'
auto_increment_key: foo_key
tag: sample
- match:
$type: stdout
<<: !include output.yml
output.yml>
$tag: "**"
```
### Your Error Log
```shell
2022-10-24 14:06:46 +0900 [error]: Failed to reload config file: expected '>' at ff.yml line 11,30
10: $type: stdout
11: <<: !include output.yml
------------------------------^
```
### Additional context
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.