Accepting request 1068009 from home:dancermak:branches:devel:microos

Add patch to let quadlet use the default runtime

OBS-URL: https://build.opensuse.org/request/show/1068009
OBS-URL: https://build.opensuse.org/package/show/devel:microos/podman?expand=0&rev=19
This commit is contained in:
Richard Brown 2023-03-01 12:12:52 +00:00 committed by Git OBS Bridge
parent 37e0b5e3ef
commit 6d6bcc24a1
3 changed files with 70 additions and 6 deletions

View File

@ -0,0 +1,60 @@
From df0fe4fcc7d54a1a8801f74bfac430f9986f0722 Mon Sep 17 00:00:00 2001
From: Ygal Blum <ygal.blum@gmail.com>
Date: Wed, 22 Feb 2023 09:36:20 +0200
Subject: [PATCH] Quadlet - use the default runtime
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Do not set the runtime when processing a .container file
Let Podman choose the runtime based on its configuration
Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
Signed-off-by: Dan Čermák <dcermak@suse.com>
(cherry picked from commit 0d75854c52e646f4c83a7a4389d8c4aebbb7ee5c)
---
pkg/systemd/quadlet/quadlet.go | 6 ++----
test/e2e/quadlet/basepodman.container | 2 +-
test/e2e/quadlet/basic.container | 1 -
3 files changed, 3 insertions(+), 6 deletions(-)
diff --git a/pkg/systemd/quadlet/quadlet.go b/pkg/systemd/quadlet/quadlet.go
index 8724eb0e156..091fcb76d46 100644
--- a/pkg/systemd/quadlet/quadlet.go
+++ b/pkg/systemd/quadlet/quadlet.go
@@ -295,11 +295,9 @@ func ConvertContainer(container *parser.UnitFile, isUser bool) (*parser.UnitFile
"--log-driver", "passthrough",
)
- // We use crun as the runtime and delegated groups to it
+ // We delegate groups to the runtime
service.Add(ServiceGroup, "Delegate", "yes")
- podman.add(
- "--runtime", "/usr/bin/crun",
- "--cgroups=split")
+ podman.add("--cgroups=split")
timezone, ok := container.Lookup(ContainerGroup, KeyTimezone)
if ok && len(timezone) > 0 {
diff --git a/test/e2e/quadlet/basepodman.container b/test/e2e/quadlet/basepodman.container
index 91e12ceb9ca..1e2c34141ab 100644
--- a/test/e2e/quadlet/basepodman.container
+++ b/test/e2e/quadlet/basepodman.container
@@ -1,4 +1,4 @@
-## assert-podman-final-args run --name=systemd-%N --cidfile=%t/%N.cid --replace --rm --log-driver passthrough --runtime /usr/bin/crun --cgroups=split --sdnotify=conmon -d localhost/imagename
+## assert-podman-final-args run --name=systemd-%N --cidfile=%t/%N.cid --replace --rm --log-driver passthrough --cgroups=split --sdnotify=conmon -d localhost/imagename
[Container]
Image=localhost/imagename
diff --git a/test/e2e/quadlet/basic.container b/test/e2e/quadlet/basic.container
index 794ded61e34..af2c325d593 100644
--- a/test/e2e/quadlet/basic.container
+++ b/test/e2e/quadlet/basic.container
@@ -5,7 +5,6 @@
## assert-podman-args "--replace"
## assert-podman-args "-d"
## assert-podman-args "--log-driver" "passthrough"
-## assert-podman-args "--runtime" "/usr/bin/crun"
## assert-podman-args "--cgroups=split"
## assert-podman-args "--sdnotify=conmon"
## assert-key-is "Unit" "RequiresMountsFor" "%t/containers"

View File

@ -1,3 +1,11 @@
-------------------------------------------------------------------
Mon Feb 27 13:54:33 UTC 2023 - Dan Čermák <dcermak@suse.com>
- Add patch to let quadlet use the default runtime
Added patch:
* Quadlet-use-the-default-runtime.patch
=> Remove dependency on crun
-------------------------------------------------------------------
Fri Feb 24 02:29:18 UTC 2023 - Danish Prakash <danish.prakash@suse.com>

View File

@ -1,7 +1,7 @@
#
# spec file for package podman
#
# Copyright (c) SUSE LLC
# Copyright (c) 2023 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -27,6 +27,7 @@ URL: https://%{project}
Source0: %{name}-%{version}.tar.xz
Source1: podman.conf
Source2: README.SUSE.SLES
Patch0: https://github.com/containers/podman/pull/17641.patch#./Quadlet-use-the-default-runtime.patch
BuildRequires: bash-completion
BuildRequires: cni
BuildRequires: device-mapper-devel
@ -51,11 +52,6 @@ Requires: catatonit >= 0.1.7
Requires: cni
Requires: cni-plugins
Requires: conmon >= 2.0.24
# FIXME: quadlet has a hard dependency on crun
# until https://github.com/containers/podman/pull/17601 is merged
# which removes the hard dependency and at which point, we should
# remove this and let users decide which runtime to use.
Requires: crun
Requires: fuse-overlayfs
Requires: iptables
Requires: libcontainers-common >= 20210626