diff --git a/cmd/helm/install.go b/cmd/helm/install.go index 40935db17..a0a165acf 100644 --- a/cmd/helm/install.go +++ b/cmd/helm/install.go @@ -113,11 +113,15 @@ func newInstallCmd(cfg *action.Configuration, out io.Writer) *cobra.Command { Args: require.MinimumNArgs(1), RunE: func(_ *cobra.Command, args []string) error { rel, err := runInstall(args, client, valueOpts, out) - if err != nil { + if rel == nil && err != nil { return err } - return outfmt.Write(out, &statusPrinter{rel, settings.Debug}) + if werr := outfmt.Write(out, &statusPrinter{rel, settings.Debug}); werr != nil { + err = werr + } + + return err }, } diff --git a/pkg/action/install.go b/pkg/action/install.go index 4019dbc54..26a1493a3 100644 --- a/pkg/action/install.go +++ b/pkg/action/install.go @@ -228,7 +228,10 @@ func (i *Install) Run(chrt *chart.Chart, vals map[string]interface{}) (*release. resources, err := i.cfg.KubeClient.Build(bytes.NewBufferString(rel.Manifest), true) if err != nil { - return nil, errors.Wrap(err, "unable to build kubernetes objects from release manifest") + err = errors.Wrap(err, "unable to build kubernetes objects from release manifest") + rel.SetStatus(release.StatusFailed, err.Error()) + // Return a release with partial data so that the client can show debugging information. + return rel, err } // Install requires an extra validation step of checking that resources