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
c359ea66
Unverified
Commit
c359ea66
authored
Jan 19, 2018
by
Matt Farina
Committed by
GitHub
Jan 19, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3350 from mattfarina/fix/3349
fix(capabilities): Adding GitVersion to default set
parents
53419364
d5a865b5
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
4 additions
and
1 deletion
+4
-1
template.go
cmd/helm/template.go
+1
-0
template_test.go
cmd/helm/template_test.go
+1
-1
capabilities.go
pkg/chartutil/capabilities.go
+1
-0
service.yaml
...l/testdata/subpop/charts/subchart1/templates/service.yaml
+1
-0
No files found.
cmd/helm/template.go
View file @
c359ea66
...
@@ -203,6 +203,7 @@ func (t *templateCmd) run(cmd *cobra.Command, args []string) error {
...
@@ -203,6 +203,7 @@ func (t *templateCmd) run(cmd *cobra.Command, args []string) error {
}
}
caps
.
KubeVersion
.
Major
=
fmt
.
Sprint
(
kv
.
Major
())
caps
.
KubeVersion
.
Major
=
fmt
.
Sprint
(
kv
.
Major
())
caps
.
KubeVersion
.
Minor
=
fmt
.
Sprint
(
kv
.
Minor
())
caps
.
KubeVersion
.
Minor
=
fmt
.
Sprint
(
kv
.
Minor
())
caps
.
KubeVersion
.
GitVersion
=
fmt
.
Sprintf
(
"v%d.%d.0"
,
kv
.
Major
(),
kv
.
Minor
())
}
}
vals
,
err
:=
chartutil
.
ToRenderValuesCaps
(
c
,
config
,
options
,
caps
)
vals
,
err
:=
chartutil
.
ToRenderValuesCaps
(
c
,
config
,
options
,
caps
)
if
err
!=
nil
{
if
err
!=
nil
{
...
...
cmd/helm/template_test.go
View file @
c359ea66
...
@@ -109,7 +109,7 @@ func TestTemplateCmd(t *testing.T) {
...
@@ -109,7 +109,7 @@ func TestTemplateCmd(t *testing.T) {
desc
:
"verify --kube-version overrides the kubernetes version"
,
desc
:
"verify --kube-version overrides the kubernetes version"
,
args
:
[]
string
{
chartPath
,
"--kube-version"
,
"1.6"
},
args
:
[]
string
{
chartPath
,
"--kube-version"
,
"1.6"
},
expectKey
:
"subchart1/templates/service.yaml"
,
expectKey
:
"subchart1/templates/service.yaml"
,
expectValue
:
"kube-version/major:
\"
1
\"\n
kube-version/minor:
\"
6
\"
"
,
expectValue
:
"kube-version/major:
\"
1
\"\n
kube-version/minor:
\"
6
\"
\n
kube-version/gitversion:
\"
v1.6.0
\"
"
,
},
},
}
}
...
...
pkg/chartutil/capabilities.go
View file @
c359ea66
...
@@ -31,6 +31,7 @@ var (
...
@@ -31,6 +31,7 @@ var (
DefaultKubeVersion
=
&
version
.
Info
{
DefaultKubeVersion
=
&
version
.
Info
{
Major
:
"1"
,
Major
:
"1"
,
Minor
:
"9"
,
Minor
:
"9"
,
GitVersion
:
"v1.9.0"
,
GoVersion
:
runtime
.
Version
(),
GoVersion
:
runtime
.
Version
(),
Compiler
:
runtime
.
Compiler
,
Compiler
:
runtime
.
Compiler
,
Platform
:
fmt
.
Sprintf
(
"%s/%s"
,
runtime
.
GOOS
,
runtime
.
GOARCH
),
Platform
:
fmt
.
Sprintf
(
"%s/%s"
,
runtime
.
GOOS
,
runtime
.
GOARCH
),
...
...
pkg/chartutil/testdata/subpop/charts/subchart1/templates/service.yaml
View file @
c359ea66
...
@@ -8,6 +8,7 @@ metadata:
...
@@ -8,6 +8,7 @@ metadata:
release-name
:
"
{{
.Release.Name
}}"
release-name
:
"
{{
.Release.Name
}}"
kube-version/major
:
"
{{
.Capabilities.KubeVersion.Major
}}"
kube-version/major
:
"
{{
.Capabilities.KubeVersion.Major
}}"
kube-version/minor
:
"
{{
.Capabilities.KubeVersion.Minor
}}"
kube-version/minor
:
"
{{
.Capabilities.KubeVersion.Minor
}}"
kube-version/gitversion
:
"
v{{
.Capabilities.KubeVersion.Major
}}.{{
.Capabilities.KubeVersion.Minor
}}.0"
spec
:
spec
:
type
:
{{
.Values.service.type
}}
type
:
{{
.Values.service.type
}}
ports
:
ports
:
...
...
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