Skip to content
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

Stop leaking plugins/{priorities,versionlock}.conf file with dnf4/5. #2538

Merged
merged 1 commit into from
Apr 30, 2024

Conversation

Romain-Geissler-1A
Copy link
Contributor

@Romain-Geissler-1A Romain-Geissler-1A commented Apr 26, 2024

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 package python3-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 install python3-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 package python3-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.

@Romain-Geissler-1A Romain-Geissler-1A changed the title Stop leaking plugins/{priorities,versionlock.conf} file with dnf4/5. Stop leaking plugins/{priorities,versionlock}.conf file with dnf4/5. Apr 26, 2024
@Conan-Kudo
Copy link
Member

This is on the right track, but it needs updates to the unit tests too. Can you try to fix them?

@Romain-Geissler-1A
Copy link
Contributor Author

Ah sorry, I saw a green CI so I didn't bother looking at this more thoroughly, I didn't expect your CI only runs if changes are kind of "pre-approved". I guess it should be ok now, at least locally it seems better now.

@Romain-Geissler-1A
Copy link
Contributor Author

Note: if this is accepted here, since it seems you also maintain the fedora package, I already submitted the backport on fedora side here ;) https://src.fedoraproject.org/rpms/kiwi/pull-request/4

@schaefi schaefi requested a review from Conan-Kudo April 29, 2024 08:00
@schaefi
Copy link
Collaborator

schaefi commented Apr 30, 2024

@Romain-Geissler-1A Thanks for your work, to me this looks great 👍 I'd like @Conan-Kudo to give his ok too since he is maintaining the Fedora side better than I do

Copy link
Member

@Conan-Kudo Conan-Kudo left a comment

Choose a reason for hiding this comment

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

Looks reasonable to me.

@Conan-Kudo Conan-Kudo merged commit cd7253b into OSInside:main Apr 30, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants