linkerd2/test
Kevin Leimkuhler 0d235694af
Add `unmeshed` flag to stat command (#4254)
## Motivation

Introduces an `unmeshed` flag to the `stat` command so that users can opt-in
to viewing unmeshed resources in the `stat` output.

This changes the existing behavior of the `stat` command such that unmeshed
resources no longer render by default in the output.

Before:

```
❯ bin/linkerd stat -A deploy
NAMESPACE     NAME                     MESHED   SUCCESS      RPS   LATENCY_P50   LATENCY_P95   LATENCY_P99   TCP_CONN
kube-system   coredns                     0/1         -        -             -             -             -          -
kube-system   local-path-provisioner      0/1         -        -             -             -             -          -
kube-system   metrics-server              0/1         -        -             -             -             -          -
kube-system   traefik                     0/1         -        -             -             -             -          -
linkerd       linkerd-controller          1/1   100.00%   0.3rps           1ms           2ms           2ms          2
linkerd       linkerd-destination         1/1   100.00%   0.3rps           1ms           1ms           1ms         11
...
```

After:

```
❯ bin/linkerd stat -A deploy
NAMESPACE   NAME                     MESHED   SUCCESS      RPS   LATENCY_P50   LATENCY_P95   LATENCY_P99   TCP_CONN
linkerd     linkerd-controller          1/1   100.00%   0.3rps           1ms           1ms           1ms          2
linkerd     linkerd-destination         1/1   100.00%   0.3rps           1ms           2ms           2ms         13
...
```

Closes #3871

## Solution

Using the meshed pod count in the stat response, resources with a count of `0`
are not rendered in the table.

The `-l`/`--selector` flag do not work for all resource types, so applying a
default label does not solve this problem. While it works for pods, it does
not work for deployments as the `linkerd.io/inject` is an annotation that
cannot be selected on.

I did not think a shorthand flag was necessary for this. I do not think users
will commonly pass this flag to the `stat` command, and I didn't think adding
an additional short flag such as `u` was necessary.

Signed-off-by: Kevin Leimkuhler <kevin@kleimkuhler.com>
2020-04-14 20:24:29 -07:00
..
edges Add integration test for external issuer and cert rotation flows (#3709) 2019-11-14 06:58:32 +02:00
egress Remove dependency on httpbin in egress integration test (#3987) 2020-02-07 19:35:51 -05:00
endpoints Remove destination container from controller (#3661) 2019-11-08 14:40:25 -08:00
externalissuer Fixed flaky integration test for ExternalIssuer (#4108) 2020-02-27 10:10:19 -05:00
get Gate SMI-Metrics behind an install flag (#4240) 2020-04-09 14:34:08 -07:00
inject Fix inject integration tests failing due to wrong golden files (#3923) 2020-01-14 12:47:16 -05:00
routes Don't hide stderr in integration tests (#3855) 2019-12-20 09:27:18 -05:00
serviceaccounts New test for checking SA lists are synced (#4201) 2020-03-26 12:54:31 -05:00
serviceprofiles Add integration test for external issuer and cert rotation flows (#3709) 2019-11-14 06:58:32 +02:00
stat Disable TestCliStatForLinkerdNamespace integration test (#3727) 2019-11-14 13:13:10 -08:00
tap proxy: v2.83.0-experimental (#3897) 2020-01-09 14:12:46 -08:00
testdata `linkerd uninstall` errors when attempting to delete PSP (#4234) 2020-04-07 11:01:11 -05:00
tracing Add distributed tracing integration test (#3920) 2020-01-16 10:57:15 -08:00
trafficsplit Add `unmeshed` flag to stat command (#4254) 2020-04-14 20:24:29 -07:00
uninstall `linkerd uninstall` errors when attempting to delete PSP (#4234) 2020-04-07 11:01:11 -05:00
install_test.go `linkerd uninstall` errors when attempting to delete PSP (#4234) 2020-04-07 11:01:11 -05:00