Skip to content

Commit

Permalink
konveyor#107 Ensure that env variable PODMAN_BIN wins (konveyor#108)
Browse files Browse the repository at this point in the history
Signed-off-by: Gerd Aschemann <[email protected]>
Signed-off-by: Emily McMullan <[email protected]>
  • Loading branch information
ascheman authored and eemcmullan committed Nov 17, 2023
1 parent 65a5822 commit 8268ba6
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions cmd/settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,14 @@ type Config struct {
}

func (c *Config) Load() error {
podmanPath, _ := exec.LookPath("podman")
if podmanPath != c.PodmanBinary && (podmanPath != "" || len(podmanPath) > 0) {
os.Setenv("PODMAN_BIN", podmanPath)
envValue := os.Getenv("PODMAN_BIN")
if envValue == "" {
podmanPath, _ := exec.LookPath("podman")
if podmanPath != c.PodmanBinary && (podmanPath != "" || len(podmanPath) > 0) {
os.Setenv("PODMAN_BIN", podmanPath)
}
}

err := env.Set(c)
if err != nil {
return err
Expand Down

0 comments on commit 8268ba6

Please sign in to comment.