From dd4f47dd98cfa823cc081cd386b88c00c215c26d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dan=20=C4=8Cerm=C3=A1k?= Date: Tue, 1 Aug 2023 23:53:42 +0200 Subject: [PATCH 1/3] Always show RemoteSocket.Exists in json MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The `Exists` field of the `RemoteSocket` struct is marshaled to json with the `omitempty` setting. This has the disadvantage that by default `podman info` shows a `remotePath` entry (the remote path is set in `pkg/domain/infra/abi/systems.go`: `(*ContainerEngine).Info`) but not that this path does not exist: ``` ❯ podman info --format json | jq .host.remoteSocket { "path": "/run/user/1000/podman/podman.sock" } ``` By removing the `omitempty`, we ensure that the existence is always shown: ``` ❯ bin/podman info --format json | jq .host.remoteSocket { "path": "/run/user/1000/podman/podman.sock", "exists": false } ``` Signed-off-by: Dan Čermák --- libpod/define/info.go | 2 +- test/e2e/info_test.go | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/libpod/define/info.go b/libpod/define/info.go index 9354ae31a9..4ba718afd6 100644 --- a/libpod/define/info.go +++ b/libpod/define/info.go @@ -68,7 +68,7 @@ type HostInfo struct { // RemoteSocket describes information about the API socket type RemoteSocket struct { Path string `json:"path,omitempty"` - Exists bool `json:"exists,omitempty"` + Exists bool `json:"exists"` } // SlirpInfo describes the slirp executable that is being used diff --git a/test/e2e/info_test.go b/test/e2e/info_test.go index 93f7a46f2a..7714c1abc2 100644 --- a/test/e2e/info_test.go +++ b/test/e2e/info_test.go @@ -118,6 +118,8 @@ var _ = Describe("Podman Info", func() { Expect(session).Should(Exit(0)) if IsRemote() { Expect(session.OutputToString()).To(ContainSubstring("true")) + } else { + Expect(session.OutputToString()).To(ContainSubstring("false")) } }) From 706c51b52b0996de2e3f201179e536fff768ea98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dan=20=C4=8Cerm=C3=A1k?= Date: Thu, 3 Aug 2023 08:27:08 +0200 Subject: [PATCH 2/3] [ci] Correct the podman systemd file names MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [NO NEW TESTS NEEDED] - this is a CI fix Co-authored-by: Chris Evich Signed-off-by: Dan Čermák --- contrib/cirrus/lib.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/cirrus/lib.sh b/contrib/cirrus/lib.sh index 265763b8b4..ddb2a0d4fd 100644 --- a/contrib/cirrus/lib.sh +++ b/contrib/cirrus/lib.sh @@ -269,7 +269,7 @@ remove_packaged_podman_files() { req_env_vars OS_RELEASE_ID # If any binaries are resident they could cause unexpected pollution - for unit in io.podman.service io.podman.socket + for unit in podman.socket podman-auto-update.timer do for state in enabled active do From b46d72fece22432fc42b0aac5830168c2778a54a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dan=20=C4=8Cerm=C3=A1k?= Date: Fri, 4 Aug 2023 16:22:11 +0200 Subject: [PATCH 3/3] [ci] Remove the podman socket in remove_packaged_podman_files() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The socket can already exist and is not removed by disabling the systemd unit, hence it needs to be deleted to get a "vanilla" system. This is a temporary workaround suggested in: https://github.com/containers/podman/pull/19478#issuecomment-1665350945 [NO NEW TESTS NEEDED] - this is a CI fix Signed-off-by: Dan Čermák --- contrib/cirrus/lib.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/contrib/cirrus/lib.sh b/contrib/cirrus/lib.sh index ddb2a0d4fd..3e88fed73b 100644 --- a/contrib/cirrus/lib.sh +++ b/contrib/cirrus/lib.sh @@ -291,6 +291,9 @@ remove_packaged_podman_files() { LISTING_CMD="rpm -ql podman" fi + # delete the podman socket in case it has been created previously + rm -f $(podman info --format "{{.Host.RemoteSocket.Path}}") + # yum/dnf/dpkg may list system directories, only remove files $LISTING_CMD | while read fullpath do