@@ -879,7 +879,11 @@ func EnsureUserIsLoggedIntoClusterSucceedsOrFails(expected string) error {
879
879
}
880
880
881
881
func EnsureOCCommandIsAvailable () error {
882
- return setOcEnv ()
882
+ err := setOcEnv ()
883
+ if err != nil {
884
+ return err
885
+ }
886
+ return setPodmanEnv ()
883
887
}
884
888
885
889
func setOcEnv () error {
@@ -889,6 +893,13 @@ func setOcEnv() error {
889
893
return util .ExecuteCommandSucceedsOrFails ("eval $(crc oc-env)" , "succeeds" )
890
894
}
891
895
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
+
892
903
func SetConfigPropertyToValueSucceedsOrFails (property string , value string , expected string ) error {
893
904
// Since network-mode is only supported on Linux, we skip this property test for non-linux platforms
894
905
if property == "network-mode" && runtime .GOOS != "linux" {
@@ -937,13 +948,13 @@ func DeletingPodSucceedsOrFails(expected string) error {
937
948
func PodmanCommandIsAvailable () error {
938
949
939
950
// 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" )
941
952
csshk := os .ExpandEnv ("${HOME}/.crc/machines/crc/id_ecdsa" )
942
953
dh := os .ExpandEnv ("unix:///${HOME}/.crc/machines/crc/docker.sock" )
943
954
ch := "ssh://[email protected] :2222/run/user/1000/podman/podman.sock"
944
955
if runtime .GOOS == "windows" {
945
956
userHomeDir , _ := os .UserHomeDir ()
946
- unexpandedPath := filepath .Join (userHomeDir , ".crc/bin/oc ;${PATH}" )
957
+ unexpandedPath := filepath .Join (userHomeDir , ".crc/bin/podman ;${PATH}" )
947
958
path = os .ExpandEnv (unexpandedPath )
948
959
csshk = filepath .Join (userHomeDir , ".crc/machines/crc/id_ecdsa" )
949
960
dh = "npipe:////./pipe/crc-podman"
0 commit comments