-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
daemon: add drop-in config fragments for custom daemon config #7784
Conversation
Hi @liubin. Thanks for your PR. I'm waiting for a containerd member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Motivation: Some components, such as snapshotter needs to configure the containerd config file dynamically, it's not so easy to modify the config file, especially by Linux command such as `sed` because the toml file has its hierarchy relations, also it has comments in the file, so simply replacing or appending is not so easy to be used to update the containerd's config file. Components write their config fragments, and letting them be imported by the `import` instrument is an ideal resolution, but modifying the `imports` instrument has the same problem as above, it's hard to edit it, for example, add, delete or change the order of the files in the import list. Solution: This commit will add the drop-in config fragments like other traditional Linux packages to containerd. Users can add their configs into the `config.d` directory along with the main config file(normally `config.toml`) but need not modify the main config file. For example, if we have a config file like this: ```toml imports = ["import-1.toml", "import-2.toml"] ``` And drop-in configs in `config.d`: ``` 10-plugin-1.toml 20-plugin-2.toml 12-plugin-3.toml ``` The drop-ins will be processed seems to be added to the `imports` item in the main config file. The result equals: ```toml imports = ["import-1.toml", "import-2.toml", "10-plugin-1.toml", "12-plugin-3.toml", "20-plugin-2.toml"] ``` And the drop-ins will have high priority than imported files. Signed-off-by: bin liu <liubin0329@gmail.com>
9a73b83
to
af13efa
Compare
I'd prefer to have one way of doing things. imports = ["*-import.toml"] (just needs masks support and sorting) |
Hi @mxpv, only using |
But you still define main config in some form, right? You can define a default directory in the main config, where containerd will look for include files, like |
Thanks for your advice, putting all config pieces by adding |
PR needs rebase. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
This PR is stale because it has been open 90 days with no activity. This PR will be closed in 7 days unless new comments are made or the stale label is removed. |
This PR was closed because it has been stalled for 7 days with no activity. |
Motivation:
Some components, such as snapshotter needs to configure the containerd config file dynamically, it's not so easy to modify the config file, especially by Linux command such as
sed
because the toml file has its hierarchy relations, also it has comments in the file, so simply replacing or appending is not so easy to be used to update the containerd's config file.Components write their config fragments, and letting them be imported by the
import
instrument is an ideal resolution, but modifying theimports
instrument has the same problem as above, it's hard to edit it, for example, add, delete or change the order of the files in the import list.Solution:
This commit will add the drop-in config fragments like other traditional Linux packages to containerd. Users can add their configs into the
config.d
directory along with the main config file(normallyconfig.toml
) but need not modify the main config file.For example, if we have a config file like this:
And drop-in configs in
config.d
:The drop-ins will be processed seems to be added to the
imports
item in the main config file. The result equals:And the drop-ins will have high priority than imported files.
Signed-off-by: bin liu liubin0329@gmail.com