Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: panic when environment variables are empty #14415

Merged
merged 1 commit into from
Jun 24, 2022
Merged

fix: panic when environment variables are empty #14415

merged 1 commit into from
Jun 24, 2022

Commits on Jun 24, 2022

  1. fix: panic when environment variables are empty

    On mac OS, environment variables like: OLDPWD are usually empty. May trigger panics like:
    ```bash
    😄  minikube v1.26.0 on Darwin 11.6.5
    panic: runtime error: index out of range [1] with length 1
    
    goroutine 1 [running]:
    k8s.io/minikube/cmd/minikube/cmd.displayEnviron({0xc000a69a40?, 0x1c, 0xb?})
    	/private/tmp/minikube-20220623-65769-c2xa25/cmd/minikube/cmd/start.go:445 +0x252
    k8s.io/minikube/cmd/minikube/cmd.runStart(0x7316040?, {0x5d07e13?, 0x0?, 0x0?})
    	/private/tmp/minikube-20220623-65769-c2xa25/cmd/minikube/cmd/start.go:157 +0x245
    github.com/spf13/cobra.(*Command).execute(0x7316040, {0x73736d8, 0x0, 0x0})
    	/Users/brew/Library/Caches/Homebrew/go_mod_cache/pkg/mod/github.com/spf13/cobra@v1.5.0/command.go:876 +0x67b
    github.com/spf13/cobra.(*Command).ExecuteC(0x7313fc0)
    	/Users/brew/Library/Caches/Homebrew/go_mod_cache/pkg/mod/github.com/spf13/cobra@v1.5.0/command.go:990 +0x3b4
    github.com/spf13/cobra.(*Command).Execute(...)
    	/Users/brew/Library/Caches/Homebrew/go_mod_cache/pkg/mod/github.com/spf13/cobra@v1.5.0/command.go:918
    k8s.io/minikube/cmd/minikube/cmd.Execute()
    	/private/tmp/minikube-20220623-65769-c2xa25/cmd/minikube/cmd/root.go:170 +0xca5
    main.main()
    	/private/tmp/minikube-20220623-65769-c2xa25/cmd/minikube/main.go:88 +0x255
    ```
    NgZiming authored Jun 24, 2022
    Configuration menu
    Copy the full SHA
    360cc86 View commit details
    Browse the repository at this point in the history