chainsaw icon indicating copy to clipboard operation
chainsaw copied to clipboard

fix: write report in format json

Open jonwinton opened this issue 8 months ago • 0 comments

Explanation

This PR's goal is to fix a bug that came up in v0.2.0 where reports are not being created when using a format of type JSON.

Related issue

https://github.com/kyverno/chainsaw/issues/1537

Proposed Changes

It looks like in https://github.com/kyverno/chainsaw/pull/1190 that the JSON report type support was removed but the case still exists. This just re-implements the old logic.

Checklist

  • [x] I have read the contributing guidelines.
  • [x] I have read the PR documentation guide and followed the process including adding proof manifests to this PR.
  • [ ] This is a bug fix and I have added unit tests that prove my fix is effective.

Further Comments

There are existing tests which declare a type of JSON in their formatter and so there is "coverage" but the error state of the JSON failing to marshal is not tested.

jonwinton avatar Jun 08 '24 16:06 jonwinton