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]>
  • Loading branch information
ascheman authored Nov 9, 2023
1 parent b5234a6 commit 698dfaf
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 698dfaf

Please sign in to comment.