Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
k8s
devtool
Commits
ac86d4ed
Commit
ac86d4ed
authored
Sep 30, 2019
by
Christopher Harm
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding k8s version configuration to devtool
parent
7532df83
Pipeline
#63051
failed with stages
in 29 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
4 deletions
+18
-4
README.md
README.md
+3
-0
cmd/start.go
cmd/start.go
+15
-4
No files found.
README.md
View file @
ac86d4ed
...
...
@@ -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
...
...
cmd/start.go
View file @
ac86d4ed
...
...
@@ -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
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment