Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
H
helm3
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
helm3
Commits
313a9dc4
Commit
313a9dc4
authored
Oct 18, 2016
by
Adam Reese
Committed by
GitHub
Oct 18, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1400 from adamreese/fix/1396-kubeconfig-namespace
fix(helm): respect kubeconfig default namespace
parents
1ea977b5
e93d5b90
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
2 deletions
+13
-2
install.go
cmd/helm/install.go
+13
-2
No files found.
cmd/helm/install.go
View file @
313a9dc4
...
...
@@ -35,6 +35,7 @@ import (
"k8s.io/helm/cmd/helm/downloader"
"k8s.io/helm/cmd/helm/helmpath"
"k8s.io/helm/pkg/helm"
"k8s.io/helm/pkg/kube"
"k8s.io/helm/pkg/proto/hapi/release"
)
...
...
@@ -127,8 +128,7 @@ func newInstallCmd(c helm.Interface, out io.Writer) *cobra.Command {
f
:=
cmd
.
Flags
()
f
.
StringVarP
(
&
inst
.
valuesFile
,
"values"
,
"f"
,
""
,
"specify values in a YAML file"
)
f
.
StringVarP
(
&
inst
.
name
,
"name"
,
"n"
,
""
,
"release name. If unspecified, it will autogenerate one for you"
)
// TODO use kubeconfig default
f
.
StringVar
(
&
inst
.
namespace
,
"namespace"
,
"default"
,
"namespace to install the release into"
)
f
.
StringVar
(
&
inst
.
namespace
,
"namespace"
,
""
,
"namespace to install the release into"
)
f
.
BoolVar
(
&
inst
.
dryRun
,
"dry-run"
,
false
,
"simulate an install"
)
f
.
BoolVar
(
&
inst
.
disableHooks
,
"no-hooks"
,
false
,
"prevent hooks from running during install"
)
f
.
BoolVar
(
&
inst
.
replace
,
"replace"
,
false
,
"re-use the given name, even if that name is already used. This is unsafe in production"
)
...
...
@@ -146,6 +146,10 @@ func (i *installCmd) run() error {
fmt
.
Fprintf
(
i
.
out
,
"CHART PATH: %s
\n
"
,
i
.
chartPath
)
}
if
i
.
namespace
==
""
{
i
.
namespace
=
defaultNamespace
()
}
rawVals
,
err
:=
i
.
vals
()
if
err
!=
nil
{
return
err
...
...
@@ -363,3 +367,10 @@ func generateName(nameTemplate string) (string, error) {
}
return
b
.
String
(),
nil
}
func
defaultNamespace
()
string
{
if
ns
,
_
,
err
:=
kube
.
GetConfig
(
kubeContext
)
.
Namespace
();
err
==
nil
{
return
ns
}
return
"default"
}
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