Skip to content

Commit 42fb570

Browse files
authored
plugin.config to plugin.yaml migration. (#13070)
* Add plugin.yaml as YAML alternative to plugin.config Introduce plugin.yaml, a YAML-based configuration file for global plugins that replaces the legacy line-based plugin.config format. New capabilities over plugin.config: - enabled: false to disable plugins without removing them - load_order for explicit plugin loading priority - NOTE-level startup log per plugin with load status - traffic_ctl plugin list via JSONRPC for runtime introspection - traffic_ctl config convert plugin_config for automated migration - Fallback: plugin.yaml takes precedence; plugin.config used if absent * Add inline config field to plugin.yaml Add the 'config' field to plugin.yaml entries, allowing plugin configuration to be embedded directly using a YAML block scalar (|). The literal text is written to a temporary file at startup and passed to the plugin as an argument. Only scalar values are accepted; structured YAML is rejected to preserve quoting semantics that plugins like txn_box rely on.
1 parent 7bf5877 commit 42fb570

34 files changed

Lines changed: 2024 additions & 23 deletions

File tree

doc/admin-guide/files/index.en.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ Configuration Files
3131
logging.yaml.en
3232
parent.config.en
3333
plugin.config.en
34+
plugin.yaml.en
3435
records.yaml.en
3536
remap.config.en
3637
remap.yaml.en
@@ -63,6 +64,10 @@ Configuration Files
6364
Control runtime loadable plugins available to |TS|, as well as their
6465
configurations.
6566

67+
:doc:`plugin.yaml.en`
68+
YAML-based alternative to :doc:`plugin.config.en` with support for
69+
disabling plugins, explicit load ordering, and inline configuration.
70+
6671
:doc:`records.yaml.en`
6772
Contains many configuration variables affecting |TS| operation.
6873

doc/admin-guide/files/plugin.config.en.rst

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,31 @@ plugin.config
2323

2424
.. configfile:: plugin.config
2525

26+
.. warning::
27+
28+
**Use** :file:`plugin.yaml` **instead.** The :file:`plugin.config` format is
29+
maintained for backward compatibility but :file:`plugin.yaml` is the
30+
recommended way to configure global plugins. It supports disabling plugins
31+
without deleting lines, explicit load ordering, and inline configuration.
32+
33+
If :file:`plugin.yaml` exists in the configuration directory, |TS| will load
34+
plugins from it and ignore :file:`plugin.config` entirely.
35+
36+
See :doc:`plugin.yaml.en` for the full reference.
37+
38+
**Migrating:** use ``traffic_ctl`` to convert an existing file automatically:
39+
40+
.. code-block:: bash
41+
42+
# Preview the converted output on stdout
43+
traffic_ctl config convert plugin_config plugin.config -
44+
45+
# Write directly to plugin.yaml
46+
traffic_ctl config convert plugin_config plugin.config plugin.yaml
47+
48+
Commented-out lines in :file:`plugin.config` are converted to
49+
``enabled: false`` entries. Pass ``--skip-disabled`` to drop them instead.
50+
2651
Description
2752
===========
2853

@@ -71,6 +96,7 @@ Examples
7196
See Also
7297
========
7398

99+
:doc:`plugin.yaml.en`,
74100
:manpage:`TSAPI(3ts)`,
75101
:manpage:`TSPluginInit(3ts)`,
76102
:manpage:`remap.config(5)`

0 commit comments

Comments
 (0)