Stop leaking plugins/{priorities,versionlock}.conf file with dnf4/5. #2538
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This fixes the fedora issue
https://bugzilla.redhat.com/show_bug.cgi?id=2270364
Description of the issue:
With Fedora 40 it seems the Fedora base image moved to being created with Kiwi while apparently Fedora <= 39 used something else. Starting with fedora 40, we can see that all OCI fedora images have one new file
/etc/dnf/plugins/versionlock.conf
which explicitly disables the versionlock plugin. If later, with this generated OCI fedora image you try to install the versionlock plugin via dnf (ie packagepython3-dnf-plugin-versionlock
then since the config file/etc/dnf/plugins/versionlock.conf
exists already, the one from the package is ignored. The end result is that when users of fedora try to installpython3-dnf-plugin-versionlock
in the end the versionlock plugin is still disabled, which is not expected.In order to fix this, I can see two possible ways. Either adding some explicit code in the
cleanup
method to correctly remove the plugin configuration files. However I really don't know your codebase and I am quite unsure when exactly is cleanup called, and to be honest it would strange to me to explicitly remove files here. Indeed if one day in the fedora base image the packagepython3-dnf-plugin-versionlock
is pre-installed then... you end up removing an actual packaged file.The other way to fix this, and the solution I propose here is to stop creating any plugin configuration file, since the only thing kiwi seems to care about is enabling/disabling plugins, and instead achieve the same activation/deactivation via command line arguments.
I discovered kiwi today, I am just trying to fix an issue I have with fedora OCI images, so excuse my lack of internal knowledge in your project ;)
Note: I tested only the dnf4 code (re-building locally the fedora images to fix my initial versionlock issue), the dnf5 code change was made blindly, reading the doc as it seems the
--disable-plugin
flag name has been renamed compared to dnf4.