From 4f3cbf15cfdb979aec3abb2915d4a1649f3b3507 Mon Sep 17 00:00:00 2001 From: Paul Holzinger Date: Fri, 24 Mar 2023 15:34:30 +0100 Subject: [PATCH 1/2] podman-mac-helper: install: do not error if already installed Since commit bae07b6ea2 we exit with 1 one errors. This caused problem for the mac installer which fails because of the error now. If the helper is already installed do not treat this as hard error and just log it instead. Signed-off-by: Paul Holzinger --- cmd/podman-mac-helper/install.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/podman-mac-helper/install.go b/cmd/podman-mac-helper/install.go index 713bdfcdfd..9e5941029a 100644 --- a/cmd/podman-mac-helper/install.go +++ b/cmd/podman-mac-helper/install.go @@ -93,7 +93,8 @@ func install(cmd *cobra.Command, args []string) error { fileName := filepath.Join("/Library", "LaunchDaemons", labelName) if _, err := os.Stat(fileName); err == nil || !os.IsNotExist(err) { - return errors.New("helper is already installed, uninstall first") + fmt.Fprintln(os.Stderr, "helper is already installed, skipping the install, uninstall first if you want to reinstall") + return nil } prog, err := installExecutable(userName) From 64ba82601a9ae67d97e694e365f76bd3341ac722 Mon Sep 17 00:00:00 2001 From: Paul Holzinger Date: Fri, 24 Mar 2023 15:39:58 +0100 Subject: [PATCH 2/2] macos pkginstaller: do not fail when podman-mac-helper fails Make sure we can install podman even when the podman-mac-helper install command fails. This used to be the behavior but commit bae07b6ea2 caused the regression because the binary now returns 1 as exit code on errors. [NO NEW TESTS NEEDED] I am not sure if we can test the install step in CI. Fixes #17910 Signed-off-by: Paul Holzinger --- contrib/pkginstaller/scripts/postinstall | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/contrib/pkginstaller/scripts/postinstall b/contrib/pkginstaller/scripts/postinstall index d60e6fd984..c34a733be5 100755 --- a/contrib/pkginstaller/scripts/postinstall +++ b/contrib/pkginstaller/scripts/postinstall @@ -7,4 +7,5 @@ echo "/opt/podman/bin" > /etc/paths.d/podman-pkg ln -s /opt/podman/bin/podman-mac-helper /opt/podman/qemu/bin/podman-mac-helper ln -s /opt/podman/bin/gvproxy /opt/podman/qemu/bin/gvproxy -/opt/podman/bin/podman-mac-helper install +# make sure to ignore errors, this is not a hard requirement to use podman +/opt/podman/bin/podman-mac-helper install || :