-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Conversation
Can one of the admins verify this patch? |
fmt.Printf("Checking for Kubectl ...\n") | ||
path, err := exec.LookPath("kubectl") | ||
if err != nil { | ||
log.Fatal("Kubectl is not installed.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you switch this to something like:
glog.Errorln("Kubectl is not installed.")
os.Exit(1)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually lets just leave this as a warning, kubectl isn't the only way to interact with kubernetes so we shouldn't error if the user doesn't have it installed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wonder if we can add a better help message to direct where to download it from?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @jimmidyson for the suggestion.I will add some nice suggestion for kubectl.
Thanks for the PR! I left a few comments. |
Thanks @dlorenc I knew it needed improvement ! I will make the changes accordingly. |
fmt.Printf("Checking for Kubectl ...\n") | ||
if _, err := exec.LookPath("kubectl") { | ||
glog.Errorln("For more info on kubectl visit http://kubernetes.io/docs/getting-started-guides/minikube/#download-kubectl") | ||
os.Exit(1) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
@@ -102,6 +103,14 @@ 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") { |
There was a problem hiding this comment.
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 {
There was a problem hiding this comment.
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 ?
This is a good first step. However:
|
@ramitsurana the travis test is failing due to the file format not being compliant with gofmt: From Travis:
The file difference:
To fix this, run gofmt on start.go with:
|
Yeah, we plan on bundling kubectl. Right now we're holding off until we get our installer story straightened out, that work is tracked here: #402 |
I'm going to close this for now. Please re-open if you get some time to finish it! |
No description provided.