diff --git a/_proto/hapi/services/tiller.proto b/_proto/hapi/services/tiller.proto index 4829633e8..729a9848e 100644 --- a/_proto/hapi/services/tiller.proto +++ b/_proto/hapi/services/tiller.proto @@ -16,7 +16,7 @@ option go_package = "services"; // config. At any given time a release has one // chart and one config. // -// Config: A config is a TOML file that supplies values +// Config: A config is a YAML file that supplies values // to the parametrizable templates of a chart. // // Chart: A chart is a helm package that contains @@ -150,7 +150,7 @@ message UpdateReleaseResponse { message InstallReleaseRequest { // Chart is the protobuf representation of a chart. hapi.chart.Chart chart = 1; - // Values is a string containing (unparsed) TOML values. + // Values is a string containing (unparsed) YAML values. hapi.chart.Config values = 2; // DryRun, if true, will run through the release logic, but neither create // a release object nor deploy to Kubernetes. The release object returned diff --git a/cmd/helm/create.go b/cmd/helm/create.go index 4270e1bbc..e99a05cc9 100644 --- a/cmd/helm/create.go +++ b/cmd/helm/create.go @@ -19,7 +19,7 @@ something like this: foo/ |- Chart.yaml # Information about your chart | - |- values.toml # The default values for your templates + |- values.yaml # The default values for your templates | |- charts/ # Charts that this chart depends on | diff --git a/cmd/helm/install.go b/cmd/helm/install.go index a8de096c5..1d0717836 100644 --- a/cmd/helm/install.go +++ b/cmd/helm/install.go @@ -42,7 +42,7 @@ var installCmd = &cobra.Command{ func init() { f := installCmd.Flags() - f.StringVarP(&installValues, "values", "f", "", "path to a values TOML file") + f.StringVarP(&installValues, "values", "f", "", "path to a values YAML file") f.StringVarP(&installRelName, "name", "n", "", "the release name. If unspecified, it will autogenerate one for you.") f.BoolVar(&installDryRun, "dry-run", false, "simulate an install") diff --git a/docs/charts.md b/docs/charts.md index ced2aa3e1..ed95e0ba8 100644 --- a/docs/charts.md +++ b/docs/charts.md @@ -25,7 +25,7 @@ wordpress/ Chart.yaml # A YAML file containing information about the chart LICENSE # OPTIONAL: A plain text file containing the license for the chart README.md # OPTIONAL: A human-readable README file - values.toml # The default configuration values for this chart + values.yaml # The default configuration values for this chart charts/ # A directory containing any charts upon which this chart depends. templates/ # A directory of templates that, when combined with values, # will generate valid Kubernetes manifest files. @@ -133,13 +133,13 @@ Helm renders the charts, it will pass every file in that directory through the template engine. Values for the templates are supplied two ways: - - Chart developers may supply a file called `values.toml` inside of a + - Chart developers may supply a file called `values.yaml` inside of a chart. This file can contain default values. - - Chart users may supply a TOML file that contains values. This can be + - Chart users may supply a YAML file that contains values. This can be provided on the command line with `helm install`. When a user supplies custom values, these values will override the -values in the chart's `values.toml` file. +values in the chart's `values.yaml` file. ### Template Files Template files follow the standard conventions for writing Go templates. @@ -207,36 +207,36 @@ used to pass arbitrarily structured data into the template. ### Values files -Considering the template in the previous section, a `values.toml` file +Considering the template in the previous section, a `values.yaml` file that supplies the necessary values would look like this: -```toml +```yaml imageRegistry = "quay.io/deis" dockerTag = "latest" pullPolicy = "alwaysPull" storage = "s3" ``` -A values file is formatted in TOML. A chart may include a default -`values.toml` file. The Helm install command allows a user to override -values by supplying additional TOML values: +A values file is formatted in YAML. A chart may include a default +`values.yaml` file. The Helm install command allows a user to override +values by supplying additional YAML values: ```console -$ helm install --values=myvals.toml wordpress +$ helm install --values=myvals.yaml wordpress ``` When values are passed in this way, they will be merged into the default -values file. For example, consider a `myvals.toml` file that looks like +values file. For example, consider a `myvals.yaml` file that looks like this: -```toml +```yaml storage = "gcs" ``` -When this is merged with the `values.toml` in the chart, the resulting +When this is merged with the `values.yaml` in the chart, the resulting generated content will be: -```toml +```yaml imageRegistry = "quay.io/deis" dockerTag = "latest" pullPolicy = "alwaysPull" @@ -246,7 +246,7 @@ storage = "gcs" Note that only the last field was overridden. **NOTE:** The default values file included inside of a chart _must_ be named -`values.toml`. But files specified on the command line can be named +`values.yaml`. But files specified on the command line can be named anything. ### Scope, Dependencies, and Values @@ -259,7 +259,7 @@ demonstration Wordpress chart above has both `mysql` and `apache` as dependencies. The values file could supply values to all of these components: -```toml +```yaml title = "My Wordpress Site" # Sent to the Wordpress template [mysql] @@ -289,7 +289,7 @@ standard references that will help you out. - [Go templates](https://godoc.org/text/template) - [Extra template functions](https://godoc.org/github.com/Masterminds/sprig) -- [The TOML format](https://github.com/toml-lang/toml) +- [The YAML format]() ## Using Helm to Manage Charts diff --git a/docs/examples/alpine/README.md b/docs/examples/alpine/README.md index a7c84fc41..5bd595747 100644 --- a/docs/examples/alpine/README.md +++ b/docs/examples/alpine/README.md @@ -3,7 +3,7 @@ This example was generated using the command `helm create alpine`. The `templates/` directory contains a very simple pod resource with a couple of parameters. -The `values.toml` file contains the default values for the +The `values.yaml` file contains the default values for the `alpine-pod.yaml` template. You can install this example using `helm install docs/examples/alpine`. diff --git a/docs/examples/alpine/values.toml b/docs/examples/alpine/values.toml deleted file mode 100644 index 504e6e1be..000000000 --- a/docs/examples/alpine/values.toml +++ /dev/null @@ -1,2 +0,0 @@ -# The pod name -name = "my-alpine" diff --git a/docs/examples/alpine/values.yaml b/docs/examples/alpine/values.yaml new file mode 100644 index 000000000..bb6c06ae4 --- /dev/null +++ b/docs/examples/alpine/values.yaml @@ -0,0 +1,2 @@ +# The pod name +name: my-alpine diff --git a/pkg/chartutil/load.go b/pkg/chartutil/load.go index c7b3b6d59..ef1662a8d 100644 --- a/pkg/chartutil/load.go +++ b/pkg/chartutil/load.go @@ -93,7 +93,9 @@ func loadFiles(files []*afile) (*chart.Chart, error) { return c, err } c.Metadata = m - } else if f.name == "values.toml" || f.name == "values.yaml" { + } else if f.name == "values.toml" { + return c, errors.New("values.toml is illegal as of 2.0.0-alpha.2") + } else if f.name == "values.yaml" { c.Values = &chart.Config{Raw: string(f.data)} } else if strings.HasPrefix(f.name, "templates/") { c.Templates = append(c.Templates, &chart.Template{Name: f.name, Data: f.data}) diff --git a/pkg/chartutil/testdata/frobnitz-1.2.3.tgz b/pkg/chartutil/testdata/frobnitz-1.2.3.tgz index 80c0a2502..31c855223 100644 Binary files a/pkg/chartutil/testdata/frobnitz-1.2.3.tgz and b/pkg/chartutil/testdata/frobnitz-1.2.3.tgz differ diff --git a/pkg/chartutil/testdata/frobnitz/charts/alpine/charts/mast1/values.yaml b/pkg/chartutil/testdata/frobnitz/charts/alpine/charts/mast1/values.yaml index f0cab9e08..42c39c262 100644 --- a/pkg/chartutil/testdata/frobnitz/charts/alpine/charts/mast1/values.yaml +++ b/pkg/chartutil/testdata/frobnitz/charts/alpine/charts/mast1/values.yaml @@ -1,4 +1,4 @@ # Default values for mast1. -# This is a TOML-formatted file. https://github.com/toml-lang/toml +# This is a YAML-formatted file. # Declare name/value pairs to be passed into your templates. # name = "value" diff --git a/pkg/chartutil/testdata/frobnitz/charts/alpine/charts/mast2-0.1.0.tgz b/pkg/chartutil/testdata/frobnitz/charts/alpine/charts/mast2-0.1.0.tgz index 232322a26..ced5a4a6a 100644 Binary files a/pkg/chartutil/testdata/frobnitz/charts/alpine/charts/mast2-0.1.0.tgz and b/pkg/chartutil/testdata/frobnitz/charts/alpine/charts/mast2-0.1.0.tgz differ diff --git a/pkg/chartutil/testdata/frobnitz/charts/mariner-4.3.2.tgz b/pkg/chartutil/testdata/frobnitz/charts/mariner-4.3.2.tgz index 3b6f987b3..90c7979af 100644 Binary files a/pkg/chartutil/testdata/frobnitz/charts/mariner-4.3.2.tgz and b/pkg/chartutil/testdata/frobnitz/charts/mariner-4.3.2.tgz differ diff --git a/pkg/chartutil/testdata/mariner/charts/albatross-0.1.0.tgz b/pkg/chartutil/testdata/mariner/charts/albatross-0.1.0.tgz index 6795b2d9e..3d5b6a242 100644 Binary files a/pkg/chartutil/testdata/mariner/charts/albatross-0.1.0.tgz and b/pkg/chartutil/testdata/mariner/charts/albatross-0.1.0.tgz differ diff --git a/pkg/engine/engine.go b/pkg/engine/engine.go index 70e809580..17254f17e 100644 --- a/pkg/engine/engine.go +++ b/pkg/engine/engine.go @@ -7,8 +7,7 @@ import ( "text/template" "github.com/Masterminds/sprig" - - chartutil "k8s.io/helm/pkg/chart" + "k8s.io/helm/pkg/chartutil" "k8s.io/helm/pkg/proto/hapi/chart" ) @@ -177,7 +176,7 @@ func coalesceValues(c *chart.Chart, v chartutil.Values) chartutil.Values { nv, err := chartutil.ReadValues([]byte(c.Values.Raw)) if err != nil { // On error, we return just the overridden values. - // FIXME: We should log this error. It indicates that the TOML data + // FIXME: We should log this error. It indicates that the YAML data // did not parse. log.Printf("error reading default values: %s", err) return v @@ -226,7 +225,7 @@ func coalesceTables(dst, src map[string]interface{}) { } } -// istable is a special-purpose function to see if the present thing matches the definition of a TOML table. +// istable is a special-purpose function to see if the present thing matches the definition of a YAML table. func istable(v interface{}) bool { _, ok := v.(map[string]interface{}) return ok diff --git a/pkg/engine/engine_test.go b/pkg/engine/engine_test.go index aa9cc4110..2d0b7de6f 100644 --- a/pkg/engine/engine_test.go +++ b/pkg/engine/engine_test.go @@ -5,7 +5,7 @@ import ( "sync" "testing" - chartutil "k8s.io/helm/pkg/chart" + "k8s.io/helm/pkg/chartutil" "k8s.io/helm/pkg/proto/hapi/chart" ) @@ -31,13 +31,12 @@ func TestRender(t *testing.T) { {Name: "test1", Data: []byte("{{.outer | title }} {{.inner | title}}")}, }, Values: &chart.Config{ - Raw: `outer = "DEFAULT"\ninner= "DEFAULT"\n`, + Raw: "outer: DEFAULT\ninner: DEFAULT", }, } vals := &chart.Config{ - Raw: `outer = "BAD" - inner= "inn"`, + Raw: "outer: BAD\ninner: inn", } overrides := map[string]interface{}{ @@ -207,18 +206,20 @@ func TestRenderNestedValues(t *testing.T) { {Name: outerpath, Data: []byte(`Gather ye {{.what}} while ye may`)}, }, Values: &chart.Config{ - Raw: `what = "stinkweed" - [herrick] - who = "time" - `}, + Raw: ` +what: stinkweed +herrick: + who: time`, + }, Dependencies: []*chart.Chart{inner}, } inject := chart.Config{ Raw: ` - what = "rosebuds" - [herrick.deepest] - what = "flower"`, +what: rosebuds +herrick: + deepest: + what: flower`, } out, err := e.Render(outer, &inject, map[string]interface{}{}) diff --git a/pkg/helm/error.go b/pkg/helm/error.go index 88dd2cd90..450999246 100644 --- a/pkg/helm/error.go +++ b/pkg/helm/error.go @@ -9,7 +9,7 @@ const ( ErrMissingTpls = Error("missing chart templates") // ErrMissingChart indicates that the Chart.yaml data is missing. ErrMissingChart = Error("missing chart metadata") - // ErrMissingValues indicates that the config values.toml data is missing. + // ErrMissingValues indicates that the config values.yaml data is missing. ErrMissingValues = Error("missing chart values") ) diff --git a/pkg/lint/lint_test.go b/pkg/lint/lint_test.go index 65f4ace7f..634b10145 100644 --- a/pkg/lint/lint_test.go +++ b/pkg/lint/lint_test.go @@ -53,8 +53,8 @@ func TestBadValues(t *testing.T) { if len(m) != 1 { t.Errorf("All didn't fail with expected errors, got %#v", m) } - if !strings.Contains(m[0].Text, "Bare keys cannot contain ':'") { - t.Errorf("All didn't have the error for invalid key format") + if !strings.Contains(m[0].Text, "cannot unmarshal") { + t.Errorf("All didn't have the error for invalid key format: %s", m[0].Text) } } diff --git a/pkg/lint/message.go b/pkg/lint/message.go index ba4eee8ff..62bf9cf58 100644 --- a/pkg/lint/message.go +++ b/pkg/lint/message.go @@ -8,7 +8,7 @@ type Severity int const ( // UnknownSev indicates that the severity of the error is unknown, and should not stop processing. UnknownSev = iota - // InfoSev indicates information, for example missing values.toml file + // InfoSev indicates information, for example missing values.yaml file InfoSev // WarningSev indicates that something does not meet code standards, but will likely function. WarningSev diff --git a/pkg/lint/testdata/albatross/values.toml b/pkg/lint/testdata/albatross/values.toml deleted file mode 100644 index 388764d49..000000000 --- a/pkg/lint/testdata/albatross/values.toml +++ /dev/null @@ -1 +0,0 @@ -name = "mariner" diff --git a/pkg/lint/testdata/albatross/values.yaml b/pkg/lint/testdata/albatross/values.yaml new file mode 100644 index 000000000..74cc6a0dc --- /dev/null +++ b/pkg/lint/testdata/albatross/values.yaml @@ -0,0 +1 @@ +name: "mariner" diff --git a/pkg/lint/testdata/badchartfile/values.toml b/pkg/lint/testdata/badchartfile/values.toml deleted file mode 100644 index d6bba222c..000000000 --- a/pkg/lint/testdata/badchartfile/values.toml +++ /dev/null @@ -1,4 +0,0 @@ -# Default values for badchartfile. -# This is a TOML-formatted file. https://github.com/toml-lang/toml -# Declare name/value pairs to be passed into your templates. -# name = "value" diff --git a/pkg/lint/testdata/badchartfile/values.yaml b/pkg/lint/testdata/badchartfile/values.yaml new file mode 100644 index 000000000..9f367033b --- /dev/null +++ b/pkg/lint/testdata/badchartfile/values.yaml @@ -0,0 +1 @@ +# Default values for badchartfile. diff --git a/pkg/lint/testdata/badvaluesfile/values.toml b/pkg/lint/testdata/badvaluesfile/values.yaml similarity index 66% rename from pkg/lint/testdata/badvaluesfile/values.toml rename to pkg/lint/testdata/badvaluesfile/values.yaml index 80488f4f7..b5a10271c 100644 --- a/pkg/lint/testdata/badvaluesfile/values.toml +++ b/pkg/lint/testdata/badvaluesfile/values.yaml @@ -1,2 +1,2 @@ -# Invalid value for badvaluesfile for testing lint fails with invalid toml format -name: "value" +# Invalid value for badvaluesfile for testing lint fails with invalid yaml format +name= "value" diff --git a/pkg/lint/testdata/goodone/values.toml b/pkg/lint/testdata/goodone/values.toml deleted file mode 100644 index 6c50ac9cc..000000000 --- a/pkg/lint/testdata/goodone/values.toml +++ /dev/null @@ -1 +0,0 @@ -name = "goodone here" diff --git a/pkg/lint/testdata/goodone/values.yaml b/pkg/lint/testdata/goodone/values.yaml new file mode 100644 index 000000000..fe9abd983 --- /dev/null +++ b/pkg/lint/testdata/goodone/values.yaml @@ -0,0 +1 @@ +name: "goodone here" diff --git a/pkg/lint/values.go b/pkg/lint/values.go index 1fb4773f3..2549f2937 100644 --- a/pkg/lint/values.go +++ b/pkg/lint/values.go @@ -4,18 +4,18 @@ import ( "os" "path/filepath" - "k8s.io/helm/pkg/chart" + "k8s.io/helm/pkg/chartutil" ) -// Values lints a chart's values.toml file. +// Values lints a chart's values.yaml file. func Values(basepath string) (messages []Message) { - vf := filepath.Join(basepath, "values.toml") + vf := filepath.Join(basepath, "values.yaml") messages = []Message{} if _, err := os.Stat(vf); err != nil { - messages = append(messages, Message{Severity: InfoSev, Text: "No values.toml file"}) + messages = append(messages, Message{Severity: InfoSev, Text: "No values.yaml file"}) return } - _, err := chart.ReadValuesFile(vf) + _, err := chartutil.ReadValuesFile(vf) if err != nil { messages = append(messages, Message{Severity: ErrorSev, Text: err.Error()}) } diff --git a/pkg/proto/hapi/services/tiller.pb.go b/pkg/proto/hapi/services/tiller.pb.go index dac4868b2..40a18d7f4 100644 --- a/pkg/proto/hapi/services/tiller.pb.go +++ b/pkg/proto/hapi/services/tiller.pb.go @@ -238,7 +238,7 @@ func (*UpdateReleaseResponse) Descriptor() ([]byte, []int) { return fileDescript type InstallReleaseRequest struct { // Chart is the protobuf representation of a chart. Chart *hapi_chart3.Chart `protobuf:"bytes,1,opt,name=chart" json:"chart,omitempty"` - // Values is a string containing (unparsed) TOML values. + // Values is a string containing (unparsed) YAML values. Values *hapi_chart.Config `protobuf:"bytes,2,opt,name=values" json:"values,omitempty"` // DryRun, if true, will run through the release logic, but neither create // a release object nor deploy to Kubernetes. The release object returned