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

adding kubectl test for minikube #398

Closed
wants to merge 4 commits into from
Closed
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion cmd/minikube/cmd/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package cmd
import (
"fmt"
"os"
"os/exec"
"strconv"
"strings"

Expand Down Expand Up @@ -49,7 +50,7 @@ var startCmd = &cobra.Command{
Use: "start",
Short: "Starts a local kubernetes cluster.",
Long: `Starts a local kubernetes cluster using Virtualbox. This command
assumes you already have Virtualbox installed.`,
assumes you already have Virtualbox & kubectl installed.`,
Run: runStart,
}

Expand Down Expand Up @@ -102,6 +103,15 @@ func runStart(cmd *cobra.Command, args []string) {
kubeHost = strings.Replace(kubeHost, ":2376", ":"+strconv.Itoa(constants.APIServerPort), -1)
fmt.Printf("Kubernetes is available at %s.\n", kubeHost)

//Checking for kubectl
fmt.Printf("Checking for Kubectl ...\n")
if _, err := exec.LookPath("kubectl") {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah sorry, you'll need:

if _, err := exec.LookPath("kubectl"); err != nil {

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still Failing :( .Could you please check again ?

glog.Errorln("For more info on kubectl visit http://kubernetes.io/docs/getting-started-guides/minikube/#download-kubectl")
os.Exit(1)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was wondering if the url can be shortened.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you drop the os.Exit(1) here? I think this should just log a warning instead of an error.

}
fmt.Printf("Kubectl is configured and installed.")


// setup kubeconfig
name := constants.MinikubeContext
certAuth := constants.MakeMiniPath("ca.crt")
Expand Down