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

[27.x backport] install_rpm_containerd: add support for dnf5 #1060

Merged
merged 3 commits into from
Sep 4, 2024

Conversation

thaJeztah
Copy link
Member

install_rpm_containerd: minor cleanup

  • use command -v for detecting dnf instead of the --version
  • quote repo-IDs to prevent globbing by the shell

install_rpm_containerd: add support for dnf5

Fedora 41 and up use the new dnf5 as default, which is a rewrite of
the dnf commands with different options;

+ dnf config-manager --add-repo https://download.docker.com/linux/fedora/docker-ce.repo
Unknown argument "--add-repo" for command "config-manager". Add "--help" for more information about the arguments.
make: *** [Makefile:95: verify] Error 2
script returned exit code 2

install_rpm_containerd: add workaround for dnf5 addrepo bug

The addrepo command has a bug that causes it to fail if the .repo file
contains empty lines, causing it to fail;

dnf config-manager addrepo --from-repofile="https://download.docker.com/linux/fedora/docker-ce.repo"
Error in added repository configuration file. Cannot set repository option "#1=
": Option "#1" not found

Use a temporary file and strip empty lines as a workaround until the bug
is fixed.

- use command -v for detecting dnf instead of the --version
- quote repo-IDs to prevent globbing by the shell

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit c47674d)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Fedora 41 and up use the new dnf5 as default, which is a rewrite of
the dnf commands with different options;

    + dnf config-manager --add-repo https://download.docker.com/linux/fedora/docker-ce.repo
    Unknown argument "--add-repo" for command "config-manager". Add "--help" for more information about the arguments.
    make: *** [Makefile:95: verify] Error 2
    script returned exit code 2

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 3fdf261)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
The addrepo command has a bug that causes it to fail if the `.repo` file
contains empty lines, causing it to fail;

    dnf config-manager addrepo --from-repofile="https://download.docker.com/linux/fedora/docker-ce.repo"
    Error in added repository configuration file. Cannot set repository option "docker#1=
    ": Option "docker#1" not found

Use a temporary file and strip empty lines as a workaround until the bug
is fixed.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit f43b3cf)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@thaJeztah thaJeztah self-assigned this Sep 4, 2024
@thaJeztah thaJeztah marked this pull request as ready for review September 4, 2024 09:22
Copy link
Contributor

@vvoland vvoland left a comment

Choose a reason for hiding this comment

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

LGTM

@thaJeztah thaJeztah merged commit cd4bd2b into docker:27.x Sep 4, 2024
7 checks passed
@thaJeztah thaJeztah deleted the 27.x_backport_rpm_dnf5_compat branch September 4, 2024 09:58
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.

2 participants