Signed-off-by: zwwhdls <zwwhdls@hotmail.com>
pull/7234/head
zwwhdls 6 years ago
parent c6d3f628bb
commit fbaeceaa60

@ -229,6 +229,16 @@ func withSampleTemplates() chartOption {
} }
} }
func withTemplatesValues() chartOption {
return func(opts *chartOptions) {
sampleTemplates := []*chart.File{
// This adds basic templates and partials.
{Name: "templates/with-values", Data: []byte("hello: {{ .Values.test.value }}")},
}
opts.Templates = append(opts.Templates, sampleTemplates...)
}
}
func withMultipleManifestTemplate() chartOption { func withMultipleManifestTemplate() chartOption {
return func(opts *chartOptions) { return func(opts *chartOptions) {
sampleTemplates := []*chart.File{ sampleTemplates := []*chart.File{

@ -111,6 +111,17 @@ func TestInstallReleaseWithValues(t *testing.T) {
is.Equal(expectedUserValues, rel.Config) is.Equal(expectedUserValues, rel.Config)
} }
func TestInstallReleaseWithoutValues(t *testing.T) {
instAction := installAction(t)
chrt := buildChart(withTemplatesValues())
_, err := instAction.Run(chrt, nil)
if err == nil {
t.Fatal("expected failure when no name is specified")
}
assert.Contains(t, err.Error(), "failed to render resource: lack of values.yaml")
}
func TestInstallReleaseClientOnly(t *testing.T) { func TestInstallReleaseClientOnly(t *testing.T) {
is := assert.New(t) is := assert.New(t)
instAction := installAction(t) instAction := installAction(t)

Loading…
Cancel
Save