Skip to content

Commit

Permalink
use err for lookpath (#118)
Browse files Browse the repository at this point in the history
* err for lookpath

Signed-off-by: Emily McMullan <[email protected]>

* update to go 1.19

Signed-off-by: Emily McMullan <[email protected]>

---------

Signed-off-by: Emily McMullan <[email protected]>
  • Loading branch information
eemcmullan authored Nov 27, 2023
1 parent 33ae6d5 commit 8022770
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 5 additions & 1 deletion cmd/settings.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package cmd

import (
"errors"
"os"
"os/exec"

Expand Down Expand Up @@ -28,7 +29,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 && errors.Is(err, exec.ErrDot) {
return err
}
if podmanPath != c.PodmanBinary && (podmanPath != "" || len(podmanPath) > 0) {
os.Setenv("PODMAN_BIN", podmanPath)
}
Expand Down

0 comments on commit 8022770

Please sign in to comment.