chore: rename savedErr to clear its specific purpose

Signed-off-by: Jeaeun Kim <me@kyoku.dev>
(cherry picked from commit 9c1d5a3b24)
release-4.2
Jeaeun Kim 4 months ago committed by Scott Rigby
parent f6211ba49b
commit ecc9cd2f1b
No known key found for this signature in database
GPG Key ID: C7C6FBB5B91C1155

@ -113,7 +113,7 @@ func newTemplateCmd(cfg *action.Configuration, out io.Writer) *cobra.Command {
} }
return err return err
} }
savedErr := err installErr := err
// We ignore a potential error here because, when the --debug flag was specified, // We ignore a potential error here because, when the --debug flag was specified,
// we always want to print the YAML, even if it is not valid. The error is still returned afterwards. // we always want to print the YAML, even if it is not valid. The error is still returned afterwards.
@ -188,9 +188,9 @@ func newTemplateCmd(cfg *action.Configuration, out io.Writer) *cobra.Command {
missing = false missing = false
} }
if missing { if missing {
if savedErr != nil && settings.Debug { if installErr != nil && settings.Debug {
// assume the manifest itself is too malformed to be rendered // assume the manifest itself is too malformed to be rendered
return savedErr return installErr
} }
return fmt.Errorf("could not find template %s in chart", f) return fmt.Errorf("could not find template %s in chart", f)
} }
@ -203,7 +203,7 @@ func newTemplateCmd(cfg *action.Configuration, out io.Writer) *cobra.Command {
} }
} }
return savedErr return installErr
}, },
} }

Loading…
Cancel
Save