From d4227ab58934b860ea8cad21cbb48e25544f86c5 Mon Sep 17 00:00:00 2001 From: Dan Lorenc Date: Wed, 4 May 2016 21:28:19 -0700 Subject: [PATCH] Add a flag for controlling the localkube binary location. --- cmd/minikube/cmd/start.go | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/cmd/minikube/cmd/start.go b/cmd/minikube/cmd/start.go index b1eb4a477a..57762ca78e 100644 --- a/cmd/minikube/cmd/start.go +++ b/cmd/minikube/cmd/start.go @@ -37,6 +37,10 @@ assumes you already have Virtualbox installed.`, Run: runStart, } +var ( + localkubeURL string +) + func runStart(cmd *cobra.Command, args []string) { fmt.Println("Starting local Kubernetes cluster...") @@ -48,7 +52,11 @@ func runStart(cmd *cobra.Command, args []string) { os.Exit(1) } - if err := cluster.StartCluster(host); err != nil { + config := cluster.KubernetesConfig{ + LocalkubeURL: localkubeURL, + } + + if err := cluster.StartCluster(host, config); err != nil { log.Println("Error starting cluster: ", err) os.Exit(1) } @@ -73,5 +81,7 @@ func runStart(cmd *cobra.Command, args []string) { } func init() { + startCmd.Flags().StringVarP(&localkubeURL, "localkube-url", "", "https://storage.googleapis.com/tinykube/localkube", "Location of the localkube binary") + startCmd.Flags().MarkHidden("localkube-url") RootCmd.AddCommand(startCmd) }