SHA256
1
0
forked from pool/podman

Accepting request 744490 from devel:kubic

To get it past staging :)

OBS-URL: https://build.opensuse.org/request/show/744490
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/podman?expand=0&rev=50
This commit is contained in:
Dominique Leuenberger 2019-11-12 10:54:33 +00:00 committed by Git OBS Bridge
parent c6d0f9bc11
commit 92a80312cf
6 changed files with 191 additions and 6 deletions

View File

@ -4,8 +4,8 @@
<param name="url">https://github.com/containers/libpod.git</param> <param name="url">https://github.com/containers/libpod.git</param>
<param name="scm">git</param> <param name="scm">git</param>
<param name="filename">podman</param> <param name="filename">podman</param>
<param name="versionformat">1.6.1</param> <param name="versionformat">1.6.2</param>
<param name="revision">v1.6.1</param> <param name="revision">v1.6.2</param>
</service> </service>
<service name="set_version" mode="disabled"> <service name="set_version" mode="disabled">

101
container-start-fix.patch Normal file
View File

@ -0,0 +1,101 @@
From 2e3f46da4f874f0c50c6b630fb6badbb052a31f2 Mon Sep 17 00:00:00 2001
From: Valentin Rothberg <rothberg@redhat.com>
Date: Thu, 31 Oct 2019 13:03:08 +0100
Subject: [PATCH] container start: fix regression when using name
When starting a container by using its name as a reference, we should
print the name instead of the ID. We regressed on this behaviour
with commit b4124485ae7e which made it into Podman v1.6.2.
Kudos to openSUSE testing for catching it. To prevent future
regressions, extend the e2e tests to check the printed container
name/ID.
Reported-by: @sysrich
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
---
pkg/adapter/containers.go | 29 +++++++++++++++++------------
test/e2e/start_test.go | 18 ++++++++++++++++--
2 files changed, 33 insertions(+), 14 deletions(-)
diff --git a/pkg/adapter/containers.go b/pkg/adapter/containers.go
index 430b6925..207cf5c6 100644
--- a/pkg/adapter/containers.go
+++ b/pkg/adapter/containers.go
@@ -656,20 +656,25 @@ func (r *LocalRuntime) Start(ctx context.Context, c *cliconfig.StartValues, sigP
return exitCode, nil
}
- if ctrRunning {
- fmt.Println(ctr.ID())
- continue
- }
- // Handle non-attach start
- // If the container is in a pod, also set to recursively start dependencies
- if err := ctr.Start(ctx, ctr.PodID() != ""); err != nil {
- if lastError != nil {
- fmt.Fprintln(os.Stderr, lastError)
+ // Start the container if it's not running already.
+ if !ctrRunning {
+ // Handle non-attach start
+ // If the container is in a pod, also set to recursively start dependencies
+ if err := ctr.Start(ctx, ctr.PodID() != ""); err != nil {
+ if lastError != nil {
+ fmt.Fprintln(os.Stderr, lastError)
+ }
+ lastError = errors.Wrapf(err, "unable to start container %q", container)
+ continue
}
- lastError = errors.Wrapf(err, "unable to start container %q", container)
- continue
}
- fmt.Println(ctr.ID())
+ // Check if the container is referenced by ID or by name and print
+ // it accordingly.
+ if strings.HasPrefix(ctr.ID(), container) {
+ fmt.Println(ctr.ID())
+ } else {
+ fmt.Println(container)
+ }
}
return exitCode, lastError
}
diff --git a/test/e2e/start_test.go b/test/e2e/start_test.go
index da581f15..09b8d201 100644
--- a/test/e2e/start_test.go
+++ b/test/e2e/start_test.go
@@ -57,15 +57,29 @@ var _ = Describe("Podman start", func() {
session = podmanTest.Podman([]string{"container", "start", cid})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
+ Expect(session.OutputToString()).To(Equal(cid))
+ })
+
+ It("podman container start single container by short id", func() {
+ session := podmanTest.Podman([]string{"container", "create", "-d", ALPINE, "ls"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ cid := session.OutputToString()
+ session = podmanTest.Podman([]string{"container", "start", cid[0:10]})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ Expect(session.OutputToString()).To(Equal(cid))
})
It("podman start single container by name", func() {
- session := podmanTest.Podman([]string{"create", "-d", "--name", "foobar99", ALPINE, "ls"})
+ name := "foobar99"
+ session := podmanTest.Podman([]string{"create", "-d", "--name", name, ALPINE, "ls"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
- session = podmanTest.Podman([]string{"start", "foobar99"})
+ session = podmanTest.Podman([]string{"start", name})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
+ Expect(session.OutputToString()).To(Equal(name))
})
It("podman start multiple containers", func() {
--
2.23.0

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:4c8840be73933523158a09bc30f7ccde6d369ba0ca20c8249ec3f45e967a8a09
size 4410492

3
podman-1.6.2.tar.xz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:1bdd4c8c03924180feea514d64128946fd788b283fbf9bd0a5be1554dfdf79e0
size 4445468

View File

@ -1,3 +1,84 @@
-------------------------------------------------------------------
Thu Oct 31 13:05:29 UTC 2019 - Richard Brown <rbrown@suse.com>
- Add container-start-fix.patch to correct output of container-start to show container_name, not _id.
-------------------------------------------------------------------
Mon Oct 21 07:21:29 UTC 2019 - Sascha Grunert <sgrunert@suse.com>
- Update podman to v1.6.2
* Features
- Added a --runtime flag to podman system migrate to allow the
OCI runtime for all containers to be reset, to ease transition
to the crun runtime on CGroups V2 systems until runc gains full
support
- The podman rm command can now remove containers in broken
states which previously could not be removed
- The podman info command, when run without root, now shows
information on UID and GID mappings in the rootless user
namespace
- Added podman build --squash-all flag, which squashes all layers
(including those of the base image) into one layer
- The --systemd flag to podman run and podman create now accepts
a string argument and allows a new value, always, which forces
systemd support without checking if the the container
entrypoint is systemd
* Bugfixes
- Fixed a bug where the podman top command did not work on
systems using CGroups V2 (#4192)
- Fixed a bug where rootless Podman could double-close a file,
leading to a panic
- Fixed a bug where rootless Podman could fail to retrieve some
containers while refreshing the state
- Fixed a bug where podman start --attach --sig-proxy=false would
still proxy signals into the container
- Fixed a bug where Podman would unconditionally use a
non-default path for authentication credentials (auth.json),
breaking podman login integration with skopeo and other tools
using the containers/image library
- Fixed a bug where podman ps --format=json and podman images
--format=json would display null when no results were returned,
instead of valid JSON
- Fixed a bug where podman build --squash was incorrectly
squashing all layers into one, instead of only new layers
- Fixed a bug where rootless Podman would allow volumes with
options to be mounted (mounting volumes requires root),
creating an inconsistent state where volumes reported as
mounted but were not (#4248)
- Fixed a bug where volumes which failed to unmount could not be
removed (#4247)
- Fixed a bug where Podman incorrectly handled some errors
relating to unmounted or missing containers in
containers/storage
- Fixed a bug where podman stats was broken on systems running
CGroups V2 when run rootless (#4268)
- Fixed a bug where the podman start command would print the
short container ID, instead of the full ID
- Fixed a bug where containers created with an OCI runtime that
is no longer available (uninstalled or removed from the config
file) would not appear in podman ps and could not be removed
via podman rm
- Fixed a bug where containers restored via podman container
restore --import would retain the CGroup path of the original
container, even if their container ID changed; thus, multiple
containers created from the same checkpoint would all share the
same CGroup
* Misc
- The default PID limit for containers is now set to 4096. It can
be adjusted back to the old default (unlimited) by passing
--pids-limit 0 to podman create and podman run
- The podman start --attach command now automatically attaches
STDIN if the container was created with -i
- The podman network create command now validates network names
using the same regular expression as container and pod names
- The --systemd flag to podman run and podman create will now
only enable systemd mode when the binary being run inside the
container is /sbin/init, /usr/sbin/init, or ends in systemd
(previously detected any path ending in init or systemd)
- Updated vendored Buildah to 1.11.3
- Updated vendored containers/storage to 1.13.5
- Updated vendored containers/image to 4.0.1
------------------------------------------------------------------- -------------------------------------------------------------------
Fri Oct 4 06:57:16 UTC 2019 - Sascha Grunert <sgrunert@suse.com> Fri Oct 4 06:57:16 UTC 2019 - Sascha Grunert <sgrunert@suse.com>

View File

@ -22,7 +22,7 @@
%define with_libostree 1 %define with_libostree 1
%endif %endif
Name: podman Name: podman
Version: 1.6.1 Version: 1.6.2
Release: 0 Release: 0
Summary: Daemon-less container engine for managing containers, pods and images Summary: Daemon-less container engine for managing containers, pods and images
License: Apache-2.0 License: Apache-2.0
@ -31,6 +31,8 @@ Url: https://github.com/containers/libpod
Source0: %{name}-%{version}.tar.xz Source0: %{name}-%{version}.tar.xz
Source2: libpod.conf Source2: libpod.conf
Source3: %{name}-rpmlintrc Source3: %{name}-rpmlintrc
# https://github.com/containers/libpod/pull/4394/files
Patch0: container-start-fix.patch
BuildRequires: bash-completion BuildRequires: bash-completion
BuildRequires: cni BuildRequires: cni
BuildRequires: device-mapper-devel BuildRequires: device-mapper-devel
@ -81,6 +83,7 @@ skopeo, as they all share the same datastore backend.
%prep %prep
%setup -q %setup -q
%patch0 -p1
%package cni-config %package cni-config
Summary: Basic CNI configuration for podman Summary: Basic CNI configuration for podman