Skip to content

bin: generate YAML configuration from CLI options - #12353

Draft
edsiper wants to merge 3 commits into
masterfrom
bin-generate-yaml-config
Draft

edsiper wants to merge 3 commits into
masterfrom
bin-generate-yaml-config

Conversation

@edsiper

@edsiper edsiper commented Sep 1, 2026

Copy link
Copy Markdown
Member

Problem

Fluent Bit command-line pipelines cannot currently be exported as reusable YAML configuration. Reconstructing configurations by hand is error-prone, especially with repeated inputs, filters, outputs, and scoped plugin properties.

Changes

  • add -G / --generate-config to emit YAML to stdout and exit
  • preserve service settings, customs, repeated pipeline components, scoped properties, tags, matches, external plugins, and stream processor tasks
  • quote YAML keys and values and escape control characters
  • reject command-line state that cannot be represented portably (--config, --workdir, and startup trace options)
  • add runtime-shell and Python integration coverage, including executing a generated pipeline

Example

fluent-bit -i tail -p path=/var/log/app.log -o stdout -G
pipeline:
  inputs:
    - "name": "tail"
      "path": "/var/log/app.log"
  outputs:
    - "name": "stdout"

Verification

  • cmake --build build -j8 --target fluent-bit-bin
  • ctest --test-dir build -R "^generate_config.sh$" --output-on-failure
  • tests/integration/.venv/bin/python -m pytest tests/integration/scenarios/cli_config_generation/tests/test_cli_config_generation.py -q
  • VALGRIND=1 VALGRIND_STRICT=1 tests/integration/.venv/bin/python -m pytest tests/integration/scenarios/cli_config_generation/tests/test_cli_config_generation.py -q
  • GITHUB_EVENT_NAME=pull_request GITHUB_BASE_REF=master .venv/bin/python .github/scripts/commit_prefix_check.py

Compatibility

-Y remains unchanged as the hot-reload option. The new short option is -G. Existing runtime behavior is unchanged unless generation is explicitly requested.

Signed-off-by: Eduardo Silva <eduardo@chronosphere.io>
Signed-off-by: Eduardo Silva <eduardo@chronosphere.io>
Signed-off-by: Eduardo Silva <eduardo@chronosphere.io>
@coderabbitai

coderabbitai Bot commented Sep 1, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant