linkerd2/multicluster
Kevin Leimkuhler 18b4d22041
`linkerd check`: handle warnings and remove extra newlines (#7379)
When running `linkerd check -o short` there can still be formatting issues:
- When there are no core warnings but there are extension warnings, a newline is printed at the start of the output
- When there are warnings, there is no newline printed between the warnings and the result

Below you can see the extra newline (before `Linkerd extensions checks`) and the lack of a newline on line before `Status check results ...`.

Old:

```shell
$ linkerd check -o short

Linkerd extensions checks
=========================

linkerd-viz
-----------
...
Status check results are √
```

New:

```shell
$ linkerd check -o short
Linkerd extensions checks
=========================

linkerd-viz
-----------
...

Status check results are √
```

---

This fixes the above issues by moving the newline printing to the end of a category—which right now is Core and Extension.

If there is no output for either, then no newline is printed. This results in no stray newlines when running in short output and there are no warnings.

```shell
$ linkerd check -o short
Status check results are √
```

If there is output for a category, then the category handles the newline printing itself meaning we don't need to track if a newline needs to be printed _before_ a category or _before_ the results.

Signed-off-by: Kevin Leimkuhler <kleimkuhler@icloud.com>
2021-12-01 17:14:06 -07:00
..
charts Add high availability mode to multicluster gateway (#7186) 2021-11-18 09:22:09 -05:00
cmd `linkerd check`: handle warnings and remove extra newlines (#7379) 2021-12-01 17:14:06 -07:00
service-mirror Expose service metadata from source service to mirrored service (#6626) 2021-08-17 16:10:32 +01:00
static build: upgrade to Go 1.17 (#7371) 2021-11-30 15:36:11 -05:00
values Add high availability mode to multicluster gateway (#7186) 2021-11-18 09:22:09 -05:00