From 65ce693af0c6325970b37bce0e9b178bc9a776b2 Mon Sep 17 00:00:00 2001 From: Emily McMullan Date: Fri, 10 Nov 2023 11:42:31 -0500 Subject: [PATCH 1/2] err for lookpath Signed-off-by: Emily McMullan --- cmd/settings.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cmd/settings.go b/cmd/settings.go index 6575085..703dee7 100644 --- a/cmd/settings.go +++ b/cmd/settings.go @@ -28,7 +28,10 @@ type Config struct { func (c *Config) Load() error { envValue := os.Getenv("PODMAN_BIN") if envValue == "" { - podmanPath, _ := exec.LookPath("podman") + podmanPath, err := exec.LookPath("podman") + if err != nil { + return err + } if podmanPath != c.PodmanBinary && (podmanPath != "" || len(podmanPath) > 0) { os.Setenv("PODMAN_BIN", podmanPath) } From f6dd44ecc7f4b72e3e078def6683439d9e81181a Mon Sep 17 00:00:00 2001 From: Emily McMullan Date: Wed, 22 Nov 2023 13:02:38 -0500 Subject: [PATCH 2/2] update to go 1.19 Signed-off-by: Emily McMullan --- Dockerfile | 2 +- cmd/settings.go | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 97d45fd..54593c0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,7 +9,7 @@ RUN microdnf -y install git &&\ FROM quay.io/konveyor/static-report as static-report # Build the manager binary -FROM golang:1.18 as builder +FROM golang:1.19 as builder WORKDIR /workspace # Copy the Go Modules manifests diff --git a/cmd/settings.go b/cmd/settings.go index 703dee7..d79a027 100644 --- a/cmd/settings.go +++ b/cmd/settings.go @@ -1,6 +1,7 @@ package cmd import ( + "errors" "os" "os/exec" @@ -29,7 +30,7 @@ func (c *Config) Load() error { envValue := os.Getenv("PODMAN_BIN") if envValue == "" { podmanPath, err := exec.LookPath("podman") - if err != nil { + if err != nil && errors.Is(err, exec.ErrDot) { return err } if podmanPath != c.PodmanBinary && (podmanPath != "" || len(podmanPath) > 0) {