Commit ac86d4ed authored by Christopher Harm's avatar Christopher Harm

Adding k8s version configuration to devtool

parent 7532df83
Pipeline #63051 failed with stages
in 29 seconds
......@@ -49,6 +49,9 @@ The devtool commands can be configured through CLI arguments, through ENV variab
minikube:
memory: 8192
cpu: 6
k8s:
version: v1.15.0
build:
skipCompile: false
runTests: true
......
......@@ -38,8 +38,8 @@ var startCmd = &cobra.Command{
memory := strconv.Itoa(viper.GetInt("minikube.memory"))
cpu := strconv.Itoa(viper.GetInt("minikube.cpu"))
start(memory, cpu)
k8sVersion := viper.GetString("minikube.k8s.version")
start(memory, cpu, k8sVersion)
},
}
......@@ -68,9 +68,16 @@ func init() {
if err != nil {
panic("invalid arg")
}
startCmd.PersistentFlags().StringP("k8s-version", "v", "", "kubernetes version for minikube")
err = viper.BindPFlag("minikube.k8s.version", startCmd.PersistentFlags().Lookup("k8s-version"))
if err != nil {
panic("invalid arg")
}
}
func start(memory, cpu string) {
func start(memory, cpu, k8sVersion string) {
color.Blue("Checking Prerequisites.")
prereqsInstalled := checkLocalSetup()
......@@ -88,7 +95,11 @@ func start(memory, cpu string) {
err := environment.Run(true, "minikube", "status")
if err != nil {
environment.RunRequired(true, "minikube", "start", "--memory", memory, "--cpus", cpu)
args := []string{"start", "--memory", memory, "--cpus", cpu}
if k8sVersion != "" {
args = append(args, "--kubernetes-version", k8sVersion)
}
environment.RunRequired(true, "minikube", args...)
}
fixKubectlContext()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment