From b47d723bfbdc6d8db7a3bb811118abe3ccbe6afa Mon Sep 17 00:00:00 2001 From: Yusuke Kuoka Date: Tue, 23 Jun 2020 09:59:05 +0900 Subject: [PATCH] A bit more helpful error message on kubeval (non-lint) error --- runner.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/runner.go b/runner.go index bece948..4ab59b9 100644 --- a/runner.go +++ b/runner.go @@ -216,7 +216,9 @@ func (r *Runner) Run() error { var conftestOut KubevalOutput if err := yaml.Unmarshal(out, &conftestOut); err != nil { - return err + fmt.Fprintf(os.Stderr, "kubeeval failed with output:\n%s", string(out)) + + return fmt.Errorf("unmarshalling yaml: %w", err) } for _, res := range conftestOut {