From 9250de0ec4196a6b14bd0a723aa3d0175fdfa26f Mon Sep 17 00:00:00 2001 From: Mateusz Gozdek Date: Fri, 25 Sep 2020 15:01:08 +0200 Subject: [PATCH] cli/cmd: annotate renderComponentManifests() errors So they are easier to trace and debug. Signed-off-by: Mateusz Gozdek --- cli/cmd/component-render-manifest.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cli/cmd/component-render-manifest.go b/cli/cmd/component-render-manifest.go index 9d6862962..7db49689a 100644 --- a/cli/cmd/component-render-manifest.go +++ b/cli/cmd/component-render-manifest.go @@ -72,7 +72,7 @@ func renderComponentManifests(lokoConfig *config.Config, componentNames []string component, err := components.Get(componentName) if err != nil { - return err + return fmt.Errorf("getting component %q: %w", componentName, err) } componentConfigBody := lokoConfig.LoadComponentConfigBody(componentName) @@ -86,7 +86,7 @@ func renderComponentManifests(lokoConfig *config.Config, componentNames []string manifests, err := component.RenderManifests() if err != nil { - return err + return fmt.Errorf("rendering manifest of component %q: %w", componentName, err) } fmt.Printf("# manifests for component %s\n", componentName)