diff --git a/cmd/helm/template.go b/cmd/helm/template.go index 85c415113d9d6a9c200e7fba13ffe3b8a0b9a710..2e81d8a8f09b9de95524f3c7a0daa11bce4fd523 100644 --- a/cmd/helm/template.go +++ b/cmd/helm/template.go @@ -194,9 +194,9 @@ func (t *templateCmd) run(cmd *cobra.Command, args []string) error { renderer := engine.New() caps := &chartutil.Capabilities{ - APIVersions: chartutil.DefaultVersionSet, - KubeVersion: chartutil.DefaultKubeVersion, - TillerVersion: tversion.GetVersionProto(), + APIVersions: chartutil.DefaultVersionSet, + KubeVersion: chartutil.DefaultKubeVersion, + HelmVersion: tversion.GetVersionProto(), } // kubernetes version diff --git a/docs/chart_best_practices/conventions.md b/docs/chart_best_practices/conventions.md index 324ef88f9a80aadd8e7023fbd9f3664de372fb28..90a25551f858a7cd7968f96987673dc489772ce3 100644 --- a/docs/chart_best_practices/conventions.md +++ b/docs/chart_best_practices/conventions.md @@ -42,12 +42,12 @@ When in doubt, use _Helm_ (with an uppercase 'H'). ## Restricting Tiller by Version -A `Chart.yaml` file can specify a `tillerVersion` SemVer constraint: +A `Chart.yaml` file can specify a `helmVersion` SemVer constraint: ```yaml name: mychart version: 0.2.0 -tillerVersion: ">=2.4.0" +helmVersion: ">=2.4.0" ``` This constraint should be set when templates use a new feature that was not diff --git a/docs/chart_template_guide/builtin_objects.md b/docs/chart_template_guide/builtin_objects.md index 11982229bcf537685d61913b8a24c2201d35f7e3..319f59a71a747f6acb79c3c288efdd91f1e6b876 100644 --- a/docs/chart_template_guide/builtin_objects.md +++ b/docs/chart_template_guide/builtin_objects.md @@ -24,7 +24,7 @@ In the previous section, we use `{{.Release.Name}}` to insert the name of a rele - `Capabilities.APIVersions` is a set of versions. - `Capabilities.APIVersions.Has $version` indicates whether a version (`batch/v1`) is enabled on the cluster. - `Capabilities.KubeVersion` provides a way to look up the Kubernetes version. It has the following values: `Major`, `Minor`, `GitVersion`, `GitCommit`, `GitTreeState`, `BuildDate`, `GoVersion`, `Compiler`, and `Platform`. - - `Capabilities.TillerVersion` provides a way to look up the Tiller version. It has the following values: `SemVer`, `GitCommit`, and `GitTreeState`. + - `Capabilities.helmVersion` provides a way to look up the Tiller version. It has the following values: `SemVer`, `GitCommit`, and `GitTreeState`. - `Template`: Contains information about the current template that is being executed - `Name`: A namespaced filepath to the current template (e.g. `mychart/templates/mytemplate.yaml`) - `BasePath`: The namespaced path to the templates directory of the current chart (e.g. `mychart/templates`). diff --git a/docs/charts.md b/docs/charts.md index a19c1a477a4129556eb8e820a4b7c80d0655497a..88ac464772587f12b732b532f1db6c33bde3a755 100644 --- a/docs/charts.md +++ b/docs/charts.md @@ -58,7 +58,7 @@ engine: gotpl # The name of the template engine (optional, defaults to gotpl) icon: A URL to an SVG or PNG image to be used as an icon (optional). appVersion: The version of the app that this contains (optional). This needn't be SemVer. deprecated: Whether this chart is deprecated (optional, boolean) -tillerVersion: The version of Tiller that this chart requires. This should be expressed as a SemVer range: ">2.0.0" (optional) +helmVersion: The version of Tiller that this chart requires. This should be expressed as a SemVer range: ">2.0.0" (optional) ``` If you are familiar with the `Chart.yaml` file format for Helm Classic, you will @@ -595,7 +595,7 @@ sensitive_. as `[]byte` using `{{.Files.GetBytes}}` - `Capabilities`: A map-like object that contains information about the versions of Kubernetes (`{{.Capabilities.KubeVersion}}`, Tiller - (`{{.Capabilities.TillerVersion}}`, and the supported Kubernetes API versions + (`{{.Capabilities.HelmVersion}}`, and the supported Kubernetes API versions (`{{.Capabilities.APIVersions.Has "batch/v1"`) **NOTE:** Any unknown Chart.yaml fields will be dropped. They will not diff --git a/pkg/chartutil/capabilities.go b/pkg/chartutil/capabilities.go index 256042802c0c753a8628bcf39e86ec0ad8c8a447..a0e68df9480dc119f7a0300fb61f8a8bfcaee6b5 100644 --- a/pkg/chartutil/capabilities.go +++ b/pkg/chartutil/capabilities.go @@ -45,10 +45,10 @@ type Capabilities struct { APIVersions VersionSet // KubeVerison is the Kubernetes version KubeVersion *version.Info - // TillerVersion is the Tiller version + // HelmVersion is the Helm version // // This always comes from pkg/version.GetVersionProto(). - TillerVersion *tversion.Version + HelmVersion *tversion.Version } // VersionSet is a set of Kubernetes API versions. diff --git a/pkg/chartutil/values_test.go b/pkg/chartutil/values_test.go index 992bb48ae6e6d3e075e943e8f6ed7b2007a1d581..170f01619bde5a1d261f7ba4730b80d5dbde5681 100644 --- a/pkg/chartutil/values_test.go +++ b/pkg/chartutil/values_test.go @@ -111,9 +111,9 @@ where: } caps := &Capabilities{ - APIVersions: DefaultVersionSet, - TillerVersion: version.GetVersionProto(), - KubeVersion: &kversion.Info{Major: "1"}, + APIVersions: DefaultVersionSet, + HelmVersion: version.GetVersionProto(), + KubeVersion: &kversion.Info{Major: "1"}, } res, err := ToRenderValuesCaps(c, v, o, caps) @@ -144,7 +144,7 @@ where: if !res["Capabilities"].(*Capabilities).APIVersions.Has("v1") { t.Error("Expected Capabilities to have v1 as an API") } - if res["Capabilities"].(*Capabilities).TillerVersion.SemVer == "" { + if res["Capabilities"].(*Capabilities).HelmVersion.SemVer == "" { t.Error("Expected Capabilities to have a Tiller version") } if res["Capabilities"].(*Capabilities).KubeVersion.Major != "1" { diff --git a/pkg/hapi/chart/template.go b/pkg/hapi/chart/file.go similarity index 100% rename from pkg/hapi/chart/template.go rename to pkg/hapi/chart/file.go diff --git a/pkg/hapi/chart/metadata.go b/pkg/hapi/chart/metadata.go index 1a9dedde63986963700adf19d34a4a70c43bbb61..30ffbf88692088f12f3f1356352d90fa76369c45 100644 --- a/pkg/hapi/chart/metadata.go +++ b/pkg/hapi/chart/metadata.go @@ -42,9 +42,9 @@ type Metadata struct { AppVersion string `json:"appVersion,omitempty"` // Whether or not this chart is deprecated Deprecated bool `json:"deprecated,omitempty"` - // TillerVersion is a SemVer constraints on what version of Tiller is required. + // HelmVersion is a SemVer constraints on what version of Tiller is required. // See SemVer ranges here: https://github.com/Masterminds/semver#basic-comparisons - TillerVersion string `json:"tillerVersion,omitempty"` + HelmVersion string `json:"helmVersion,omitempty"` // Annotations are additional mappings uninterpreted by Tiller, // made available for inspection by other applications. Annotations map[string]string `json:"annotations,omitempty"` diff --git a/pkg/lint/rules/template.go b/pkg/lint/rules/template.go index 3478912676bb1469a981fe105503fe4cd917b9e2..35bceaf25a5005e1371fe398260a62dbdadcd9e2 100644 --- a/pkg/lint/rules/template.go +++ b/pkg/lint/rules/template.go @@ -54,9 +54,9 @@ func Templates(linter *support.Linter, values []byte, namespace string, strict b options := chartutil.ReleaseOptions{Name: "testRelease", Time: time.Now(), Namespace: namespace} caps := &chartutil.Capabilities{ - APIVersions: chartutil.DefaultVersionSet, - KubeVersion: chartutil.DefaultKubeVersion, - TillerVersion: tversion.GetVersionProto(), + APIVersions: chartutil.DefaultVersionSet, + KubeVersion: chartutil.DefaultKubeVersion, + HelmVersion: tversion.GetVersionProto(), } cvals, err := chartutil.CoalesceValues(chart, values) if err != nil { diff --git a/pkg/lint/rules/testdata/albatross/templates/svc.yaml b/pkg/lint/rules/testdata/albatross/templates/svc.yaml index 1671481125c75aeff69689895e1789a5d280a8f3..bf1c1761c6270b7c76452a75a2f10e15b7afc325 100644 --- a/pkg/lint/rules/testdata/albatross/templates/svc.yaml +++ b/pkg/lint/rules/testdata/albatross/templates/svc.yaml @@ -9,7 +9,7 @@ metadata: release: {{ .Release.Name | quote }} chart: "{{.Chart.Name}}-{{.Chart.Version}}" kubeVersion: {{ .Capabilities.KubeVersion.Major }} - tillerVersion: {{ .Capabilities.TillerVersion }} + helmVersion: {{ .Capabilities.HelmVersion }} spec: ports: - port: {{default 80 .Values.httpPort | quote}} diff --git a/pkg/tiller/release_server.go b/pkg/tiller/release_server.go index 46db4eef280331812162bc1f08d1079a43037a9e..db6f150da3a22aa3f9b71c3680d24cde6f72c2e1 100644 --- a/pkg/tiller/release_server.go +++ b/pkg/tiller/release_server.go @@ -225,9 +225,9 @@ func capabilities(disc discovery.DiscoveryInterface) (*chartutil.Capabilities, e return nil, fmt.Errorf("Could not get apiVersions from Kubernetes: %s", err) } return &chartutil.Capabilities{ - APIVersions: vs, - KubeVersion: sv, - TillerVersion: version.GetVersionProto(), + APIVersions: vs, + KubeVersion: sv, + HelmVersion: version.GetVersionProto(), }, nil } @@ -253,8 +253,8 @@ func GetVersionSet(client discovery.ServerGroupsInterface) (chartutil.VersionSet func (s *ReleaseServer) renderResources(ch *chart.Chart, values chartutil.Values, vs chartutil.VersionSet) ([]*release.Hook, *bytes.Buffer, string, error) { // Guard to make sure Tiller is at the right version to handle this chart. sver := version.GetVersion() - if ch.Metadata.TillerVersion != "" && - !version.IsCompatibleRange(ch.Metadata.TillerVersion, sver) { + if ch.Metadata.HelmVersion != "" && + !version.IsCompatibleRange(ch.Metadata.HelmVersion, sver) { return nil, nil, "", fmt.Errorf("Chart incompatible with Tiller %s", sver) }