Skip to content

Commit fcbb3e6

Browse files
Jakub Sliacanadrianriobo
Jakub Sliacan
authored andcommitted
qe: add podman command to path
Re: crc-org#4025
1 parent 8f082a2 commit fcbb3e6

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

test/e2e/testsuite/testsuite.go

+14-3
Original file line numberDiff line numberDiff line change
@@ -879,7 +879,11 @@ func EnsureUserIsLoggedIntoClusterSucceedsOrFails(expected string) error {
879879
}
880880

881881
func EnsureOCCommandIsAvailable() error {
882-
return setOcEnv()
882+
err := setOcEnv()
883+
if err != nil {
884+
return err
885+
}
886+
return setPodmanEnv()
883887
}
884888

885889
func setOcEnv() error {
@@ -889,6 +893,13 @@ func setOcEnv() error {
889893
return util.ExecuteCommandSucceedsOrFails("eval $(crc oc-env)", "succeeds")
890894
}
891895

896+
func setPodmanEnv() error {
897+
if runtime.GOOS == "windows" {
898+
return util.ExecuteCommandSucceedsOrFails("crc podman-env | Invoke-Expression", "succeeds")
899+
}
900+
return util.ExecuteCommandSucceedsOrFails("eval $(crc podman-env)", "succeeds")
901+
}
902+
892903
func SetConfigPropertyToValueSucceedsOrFails(property string, value string, expected string) error {
893904
// Since network-mode is only supported on Linux, we skip this property test for non-linux platforms
894905
if property == "network-mode" && runtime.GOOS != "linux" {
@@ -937,13 +948,13 @@ func DeletingPodSucceedsOrFails(expected string) error {
937948
func PodmanCommandIsAvailable() error {
938949

939950
// Do what 'eval $(crc podman-env) would do
940-
path := os.ExpandEnv("${HOME}/.crc/bin/oc:$PATH")
951+
path := os.ExpandEnv("${HOME}/.crc/bin/podman:$PATH")
941952
csshk := os.ExpandEnv("${HOME}/.crc/machines/crc/id_ecdsa")
942953
dh := os.ExpandEnv("unix:///${HOME}/.crc/machines/crc/docker.sock")
943954
ch := "ssh://[email protected]:2222/run/user/1000/podman/podman.sock"
944955
if runtime.GOOS == "windows" {
945956
userHomeDir, _ := os.UserHomeDir()
946-
unexpandedPath := filepath.Join(userHomeDir, ".crc/bin/oc;${PATH}")
957+
unexpandedPath := filepath.Join(userHomeDir, ".crc/bin/podman;${PATH}")
947958
path = os.ExpandEnv(unexpandedPath)
948959
csshk = filepath.Join(userHomeDir, ".crc/machines/crc/id_ecdsa")
949960
dh = "npipe:////./pipe/crc-podman"

0 commit comments

Comments
 (0)