Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cmd/tetra: use text/tabwriter to format tp list output
Also add the support of load error by reusing the metric state recap. Previously, the output of `tetra tp list` was a bit chaotic, for example, with 2 policies, with one with a loading error, it looked like the following: [1] invalid enabled:false filterID:0 namespace:(global) sensors: loadError: "policy handler 'tracing' failed loading policy 'invalid': tracing [...] [2] block-binary enabled:true filterID:0 namespace:(global) sensors:gkp-sensor-1 Now, using text/tabwriter, we redact the errors (use -o json for full output) and put everything in columns: ID NAME STATE FILTERID NAMESPACE SENSORS 1 invalid load_error 0 (global) 2 block-binary enabled 0 (global) gkp-sensor-1 Signed-off-by: Mahe Tardy <mahe.tardy@gmail.com>
- Loading branch information