mirror of https://github.com/linkerd/linkerd2.git
Closes #776. This branch adds the following validation to the `linkerd stat` command: * The `--to` and `--from` flags are now mutually exclusive * The `--to-namespace` and `--from-namespace` commands are also mutually exclusive. * The `namespace` resource type conflicts with the `--namespace`, `--to-namespace`, and `--from-namespace` flags. Examples: ``` $ bin/go-run cli/main.go stat deploy --to deploy/foo --from deploy/bar Error: --to and --from flags are mutually exclusive Usage: linkerd stat [flags] (RESOURCE) ... ``` ``` $ bin/go-run cli/main.go stat deploy --to-namespace foo --from-namespace bar Error: --to-namespace and --from-namespace flags are mutually exclusive Usage: linkerd stat [flags] (RESOURCE) ... ``` ``` $ bin/go-run cli/main.go stat namespace foo --namespace bar Error: --namespace flag is incompatible with namespace resource type Usage: linkerd stat [flags] (RESOURCE) ... ``` ``` $ bin/go-run cli/main.go stat ns --to-namespace bar Error: --to-namespace flag is incompatible with namespace resource type Usage: linkerd stat [flags] (RESOURCE) ... ``` ``` $ bin/go-run cli/main.go stat namespace --from-namespace bar Error: --from-namespace flag is incompatible with namespace resource type Usage: linkerd stat [flags] (RESOURCE) ... ``` ``` $ bin/go-run cli/main.go stat ns/foo --from-namespace bar Error: --from-namespace flag is incompatible with namespace resource type Usage: linkerd stat [flags] (RESOURCE) ... ``` Signed-off-by: Eliza Weisman <eliza@buoyant.io> |
||
---|---|---|
.. | ||
cmd | ||
install | ||
Dockerfile-bin | ||
main.go |