Skip to content
This repository was archived by the owner on May 21, 2026. It is now read-only.

remove default "containerd.toml" config file#215

Merged
thaJeztah merged 1 commit into
docker:masterfrom
thaJeztah:remove_containerd_config
Apr 22, 2021
Merged

remove default "containerd.toml" config file#215
thaJeztah merged 1 commit into
docker:masterfrom
thaJeztah:remove_containerd_config

Conversation

@thaJeztah

Copy link
Copy Markdown
Member

This configuration file was used to disable the CRI plugin to work around an
issue where CRI was automatically listening for remote connections.

That problem was resolved, so we no longer need a customized configuration.

Addresses containerd/containerd#4956

@thaJeztah

Copy link
Copy Markdown
Member Author

@cpuguy83 @oldthreefeng @tiborvass PTAL

cpuguy83
cpuguy83 previously approved these changes Jan 22, 2021

@cpuguy83 cpuguy83 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@oldthreefeng

Copy link
Copy Markdown

LGTM

@thaJeztah

Copy link
Copy Markdown
Member Author

whoops; missed a reference to that file in the rpm spec; pushing a fix now

This configuration file was used to disable the CRI plugin to work around an
issue where CRI was automatically listening for remote connections.

That problem was resolved, so we no longer need a customized configuration.

Signed-off-by: Sebastiaan van Stijn <[email protected]>
@thaJeztah
thaJeztah force-pushed the remove_containerd_config branch from e7bc510 to 37e406c Compare January 22, 2021 15:24
Comment thread rpm/containerd.spec
%{_unitdir}/containerd.service
%{_sysconfdir}/containerd
%{_mandir}/man*/*
%config(noreplace) %{_sysconfdir}/containerd/config.toml

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the only part I was looking at if this could have side-effects (file and directory no longer marked as "config"). I think it should have no consequences (package no longer knows of this path, so won't interfere with it), but if someone knows if this is a concern, let me know.

@ravilr ravilr May 14, 2021

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@thaJeztah removing this does have some impact on rpm users who are currently overwriting the rpm supplied config.toml with their own. This being removed above, causes the user supplied override config.toml file also to be deleted, when they upgrade to a rpm version with this change. rpm moves the file to.rpmsave/.rpmnew after upgrading to the new version with the above change.

Can we just continue shipping an empty config.toml with just version=2 without the disabled cri plugin config ?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ravilr hmmm... yeah, we could partially revert that change if there's no other way; do you know if rpms allow for the change to be "ignored" (as in: don't touch the existing file?)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

according to https://rpm-packaging-guide.github.io/#files, %config(noreplace) exists to protect local modifications to a config file, so that local edits to config files won't get lost during a subsequent upgrade.
But, since the file is being removed from rpm, that doesn't apply here.

IMO, if the intention is to get rid of disabling of cri plugin, then rpm packaging here should continue shipping an empty config.toml with %config(noreplace).

@thaJeztah

Copy link
Copy Markdown
Member Author

Updated; and all green now; @cpuguy83 @tianon PTAL 🤗

@tianon

tianon commented Jan 25, 2021

Copy link
Copy Markdown
Contributor

Nice! 👍

Debian has a conffiles thing that might interfere here (https://www.debian.org/doc/manuals/maint-guide/dother.en.html#conffiles; by default it marks anything installed to /etc as a "conffile" which then needs extras to properly remove/manage).

We probably need a <package>.maintscript file that includes rm_conffile /etc/containerd/config.toml (https://manpages.debian.org/buster/debhelper/dh_installdeb.1.en.html, https://manpages.debian.org/buster/dpkg/dpkg-maintscript-helper.1.en.html).

@thaJeztah

Copy link
Copy Markdown
Member Author

We probably need a .maintscript file that includes rm_conffile /etc/containerd/config.toml (https://manpages.debian.org/buster/debhelper/dh_installdeb.1.en.html, https://manpages.debian.org/buster/dpkg/dpkg-maintscript-helper.1.en.html).

@tianon IIUC, you mean "add a script that removes the config file when installing the new package"? I wonder if we should do that; even though we provided a "default", we also marked the file as noreplace, which (IIUC) means that a user could have added their own custom configuration file there (in which case we wouldn't overwrite it). If we would do a "remove" of that file when installing the package, we would remove their custom config, right?

Or do you mean the "reverse"; prevent the default behavior of .deb from removing the file, now that we no longer list it (and mark it with noreplace ? (that was my initial concern with removing that line)

@tianon

tianon commented Jan 28, 2021

Copy link
Copy Markdown
Contributor

Discussed in maintainers meeting with @thaJeztah @cpuguy83; the config file we were installing is very benign and shouldn't cause problems for any existing users if it doesn't get cleaned up (and the chance of breaking changes to that config file syntax are low), so this is purely a perfectionism / cleanliness concern and should be relatively harmless to ignore.

In other words, we do not need to include rm_conffile and it should be fine to just leave alone and stop adding for new installs.

@zhsj

zhsj commented Jan 30, 2021

Copy link
Copy Markdown

fwiw, rm_conffile in dpkg-maintscript-helper will not remove conffile if it has been modified by users. dpkg has md5sum of the conffile which is used when removing.

@zhsj

zhsj commented Jan 30, 2021

Copy link
Copy Markdown

fwiw, rm_conffile in dpkg-maintscript-helper will not remove conffile if it has been modified by users. dpkg has md5sum of the conffile which is used when removing.

ha, seems i misread the above discussion... (just to ignore that)

@thaJeztah

Copy link
Copy Markdown
Member Author

ha, seems i misread the above discussion... (just to ignore that)

No worries; thanks for looking! Yes, we discussed for a bit, and thought it was not worth the extra complexity to clean up the file (which is mostly harmless)

@thaJeztah

Copy link
Copy Markdown
Member Author

@silvin-lubecki @tiborvass ptal; this one good to go?

@silvin-lubecki silvin-lubecki left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@thaJeztah

Copy link
Copy Markdown
Member Author

@tiborvass ptal

@fuweid fuweid left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM(nb)

@thaJeztah

Copy link
Copy Markdown
Member Author

Given that this fix is not critical, and it's been pending for a while, I think it should be ok to merge this after #223 has been merged and released (keeping the diff for that release small, as it's a security release, so better to not include too many other changes)

@kzys

kzys commented Apr 22, 2021

Copy link
Copy Markdown

@thaJeztah #223 has been merged and it has been released as Docker Engine 20.10.6. So I think we can merge this PR now.

@thaJeztah

Copy link
Copy Markdown
Member Author

Ah, yes, let's get this one in 👍

@thaJeztah
thaJeztah merged commit e0ff9a3 into docker:master Apr 22, 2021
@thaJeztah
thaJeztah deleted the remove_containerd_config branch April 22, 2021 19:27
@ravilr ravilr mentioned this pull request May 14, 2021
thaJeztah added a commit to thaJeztah/containerd-packaging that referenced this pull request May 19, 2021
This reverts commit 37e406c.

Relates to docker#215 (comment)

> removing this does have some impact on rpm users who are currently overwriting
> the rpm supplied config.toml with their own. This being removed above, causes
> the user supplied override config.toml file also to be deleted, when they upgrade
> to a rpm version with this change. rpm moves the file to.rpmsave/.rpmnew after
> upgrading to the new version with the above change.

Reverting this change (at least temporarily until we figure out an alternative)
is the safest option for now.

Signed-off-by: Sebastiaan van Stijn <[email protected]>
@thaJeztah

Copy link
Copy Markdown
Member Author

Opened #233 to (temporarily) revert while we figure out an approach for #215 (comment)

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants