To make the install comand consistent with upgrade comand when handling errors

Signed-off-by: Stephane Moser <moser.sts@gmail.com>
pull/9180/head
Stephane Moser 3 years ago
parent 4bc901c95f
commit 101370af3d

@ -124,7 +124,7 @@ func newInstallCmd(cfg *action.Configuration, out io.Writer) *cobra.Command {
RunE: func(_ *cobra.Command, args []string) error {
rel, err := runInstall(args, client, valueOpts, out)
if err != nil {
return err
return errors.Wrap(err, "INSTALLATION FAILED")
}
return outfmt.Write(out, &statusPrinter{rel, settings.Debug, false})

@ -169,7 +169,7 @@ func TestInstall(t *testing.T) {
name: "install library chart",
cmd: "install libchart testdata/testcharts/lib-chart",
wantError: true,
golden: "output/template-lib-chart.txt",
golden: "output/install-lib-chart.txt",
},
// Install, chart with bad type
{

@ -62,7 +62,7 @@ func TestTemplateCmd(t *testing.T) {
name: "check chart bad type",
cmd: fmt.Sprintf("template '%s'", "testdata/testcharts/chart-bad-type"),
wantError: true,
golden: "output/install-chart-bad-type.txt",
golden: "output/template-chart-bad-type.txt",
},
{
name: "check chart with dependency which is an app chart acting as a library chart",

@ -1 +1 @@
Error: validation: chart.metadata.type must be application or library
Error: INSTALLATION FAILED: validation: chart.metadata.type must be application or library

@ -0,0 +1 @@
Error: INSTALLATION FAILED: validation: chart.metadata.type must be application or library

@ -1,4 +1,4 @@
Error: values don't meet the specifications of the schema(s) in the following chart(s):
Error: INSTALLATION FAILED: values don't meet the specifications of the schema(s) in the following chart(s):
empty:
- age: Must be greater than or equal to 0

@ -1,4 +1,4 @@
Error: values don't meet the specifications of the schema(s) in the following chart(s):
Error: INSTALLATION FAILED: values don't meet the specifications of the schema(s) in the following chart(s):
empty:
- (root): employmentInfo is required
- age: Must be greater than or equal to 0

@ -1,4 +1,4 @@
Error: values don't meet the specifications of the schema(s) in the following chart(s):
Error: INSTALLATION FAILED: values don't meet the specifications of the schema(s) in the following chart(s):
subchart-with-schema:
- age: Must be greater than or equal to 0

@ -1,4 +1,4 @@
Error: values don't meet the specifications of the schema(s) in the following chart(s):
Error: INSTALLATION FAILED: values don't meet the specifications of the schema(s) in the following chart(s):
chart-without-schema:
- (root): lastname is required
subchart-with-schema:

@ -0,0 +1 @@
Error: validation: chart.metadata.type must be application or library
Loading…
Cancel
Save