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
3508cebb
Commit
3508cebb
authored
Sep 11, 2017
by
Kazuki Suda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use the same defaults as done in helm lint for Capabilities
parent
e742aa8d
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
12 deletions
+24
-12
template.go
cmd/helm/template.go
+7
-1
capabilities.go
pkg/chartutil/capabilities.go
+16
-2
template.go
pkg/lint/rules/template.go
+1
-9
No files found.
cmd/helm/template.go
View file @
3508cebb
...
@@ -35,6 +35,7 @@ import (
...
@@ -35,6 +35,7 @@ import (
util
"k8s.io/helm/pkg/releaseutil"
util
"k8s.io/helm/pkg/releaseutil"
"k8s.io/helm/pkg/tiller"
"k8s.io/helm/pkg/tiller"
"k8s.io/helm/pkg/timeconv"
"k8s.io/helm/pkg/timeconv"
tversion
"k8s.io/helm/pkg/version"
)
)
const
templateDesc
=
`
const
templateDesc
=
`
...
@@ -171,7 +172,12 @@ func (t *templateCmd) run(cmd *cobra.Command, args []string) error {
...
@@ -171,7 +172,12 @@ func (t *templateCmd) run(cmd *cobra.Command, args []string) error {
// Set up engine.
// Set up engine.
renderer
:=
engine
.
New
()
renderer
:=
engine
.
New
()
vals
,
err
:=
chartutil
.
ToRenderValues
(
c
,
config
,
options
)
caps
:=
&
chartutil
.
Capabilities
{
APIVersions
:
chartutil
.
DefaultVersionSet
,
KubeVersion
:
chartutil
.
DefaultKubeVersion
,
TillerVersion
:
tversion
.
GetVersionProto
(),
}
vals
,
err
:=
chartutil
.
ToRenderValuesCaps
(
c
,
config
,
options
,
caps
)
if
err
!=
nil
{
if
err
!=
nil
{
return
err
return
err
}
}
...
...
pkg/chartutil/capabilities.go
View file @
3508cebb
...
@@ -16,12 +16,26 @@ limitations under the License.
...
@@ -16,12 +16,26 @@ limitations under the License.
package
chartutil
package
chartutil
import
(
import
(
"fmt"
"runtime"
"k8s.io/apimachinery/pkg/version"
"k8s.io/apimachinery/pkg/version"
tversion
"k8s.io/helm/pkg/proto/hapi/version"
tversion
"k8s.io/helm/pkg/proto/hapi/version"
)
)
// DefaultVersionSet is the default version set, which includes only Core V1 ("v1").
var
(
var
DefaultVersionSet
=
NewVersionSet
(
"v1"
)
// DefaultVersionSet is the default version set, which includes only Core V1 ("v1").
DefaultVersionSet
=
NewVersionSet
(
"v1"
)
// DefaultKubeVersion is the default kubernetes version
DefaultKubeVersion
=
&
version
.
Info
{
Major
:
"1"
,
Minor
:
"7"
,
GoVersion
:
runtime
.
Version
(),
Compiler
:
runtime
.
Compiler
,
Platform
:
fmt
.
Sprintf
(
"%s/%s"
,
runtime
.
GOOS
,
runtime
.
GOARCH
),
}
)
// Capabilities describes the capabilities of the Kubernetes cluster that Tiller is attached to.
// Capabilities describes the capabilities of the Kubernetes cluster that Tiller is attached to.
type
Capabilities
struct
{
type
Capabilities
struct
{
...
...
pkg/lint/rules/template.go
View file @
3508cebb
...
@@ -21,10 +21,8 @@ import (
...
@@ -21,10 +21,8 @@ import (
"fmt"
"fmt"
"os"
"os"
"path/filepath"
"path/filepath"
"runtime"
"github.com/ghodss/yaml"
"github.com/ghodss/yaml"
"k8s.io/apimachinery/pkg/version"
"k8s.io/helm/pkg/chartutil"
"k8s.io/helm/pkg/chartutil"
"k8s.io/helm/pkg/engine"
"k8s.io/helm/pkg/engine"
"k8s.io/helm/pkg/lint/support"
"k8s.io/helm/pkg/lint/support"
...
@@ -56,13 +54,7 @@ func Templates(linter *support.Linter) {
...
@@ -56,13 +54,7 @@ func Templates(linter *support.Linter) {
options
:=
chartutil
.
ReleaseOptions
{
Name
:
"testRelease"
,
Time
:
timeconv
.
Now
(),
Namespace
:
"testNamespace"
}
options
:=
chartutil
.
ReleaseOptions
{
Name
:
"testRelease"
,
Time
:
timeconv
.
Now
(),
Namespace
:
"testNamespace"
}
caps
:=
&
chartutil
.
Capabilities
{
caps
:=
&
chartutil
.
Capabilities
{
APIVersions
:
chartutil
.
DefaultVersionSet
,
APIVersions
:
chartutil
.
DefaultVersionSet
,
KubeVersion
:
&
version
.
Info
{
KubeVersion
:
chartutil
.
DefaultKubeVersion
,
Major
:
"1"
,
Minor
:
"7"
,
GoVersion
:
runtime
.
Version
(),
Compiler
:
runtime
.
Compiler
,
Platform
:
fmt
.
Sprintf
(
"%s/%s"
,
runtime
.
GOOS
,
runtime
.
GOARCH
),
},
TillerVersion
:
tversion
.
GetVersionProto
(),
TillerVersion
:
tversion
.
GetVersionProto
(),
}
}
valuesToRender
,
err
:=
chartutil
.
ToRenderValuesCaps
(
chart
,
chart
.
Values
,
options
,
caps
)
valuesToRender
,
err
:=
chartutil
.
ToRenderValuesCaps
(
chart
,
chart
.
Values
,
options
,
caps
)
...
...
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