improve messaging of fleetctl debug errors and archive commands (#5590)

Related to https://github.com/fleetdm/fleet/issues/5504, this change attempts to improve the output of the `fleetctl debug errors` command by:

- Adding a warning message to redact sensitive data
- Adding a `json` extension to the output file
- Allowing to stream the output to stdout via the `-stdout` flag or the `STDOUT` env var

The output after this changes is:

```
~/projects/fleet $ ./build/fleetctl debug errors
################################################################################
# WARNING:
#   The generated file may contain sensitive data.
#   Please review the file before sharing.
#
#   Output written to: fleet-errors-2022-05-05T12:46:42-03:00.json
################################################################################
```

It also modifies the output of `fleetctl debug archive`

```
################################################################################
# WARNING:
#   The files in the generated archive may contain sensitive data.
#   Please review them before sharing.
#
#   Archive written to: fleet-profiles-archive-2022-05-05T12:46:59-03:00.tar.gz
################################################################################
```
This commit is contained in:
Roberto Dip
2022-05-10 10:44:06 -03:00
committed by GitHub
parent b52ce46627
commit 33a482448b
5 changed files with 88 additions and 23 deletions
+1
View File
@@ -0,0 +1 @@
* Improve the output of `fleetclt debug errors` and add the ability to print the errors to stdout via the `-stdout` flag.