Skip to content

Commit c84067c

Browse files
authored
Merge pull request #7887 from medyagh/bash_fallback_docker_env
docker-env: fall back to bash if can not detect shell.
2 parents c6e0f7f + 191484e commit c84067c

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

cmd/minikube/cmd/docker-env.go

+10-1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ import (
2727
"strconv"
2828
"strings"
2929

30+
lib_shell "github.com/docker/machine/libmachine/shell"
31+
"github.com/golang/glog"
3032
"github.com/spf13/cobra"
3133
"k8s.io/minikube/pkg/drivers/kic/oci"
3234
"k8s.io/minikube/pkg/minikube/command"
@@ -168,7 +170,14 @@ var dockerEnvCmd = &cobra.Command{
168170
if ec.Shell == "" {
169171
ec.Shell, err = shell.Detect()
170172
if err != nil {
171-
exit.WithError("Error detecting shell", err)
173+
// if we can't detect it could be bash. for example github actions
174+
if err == lib_shell.ErrUnknownShell {
175+
ec.Shell = "bash"
176+
glog.Warningf("couldn't detect shell type, will default to bash: %v", err)
177+
} else {
178+
exit.WithError("Error detecting shell", err)
179+
}
180+
172181
}
173182
}
174183

0 commit comments

Comments
 (0)