We add support for the `--output/-o` flag in linkerd install and related commands. The supported output formats are yaml (default) and json. Kubectl is able to accept both of these formats which means that the output can be piped into kubectl regardless of which output format is used.
The full list of install related commands which we add json support to is:
* linkerd install
* linkerd prune
* linkerd upgrade
* linkerd uninstall
* linkerd viz install
* linkerd viz prune
* linkerd viz uninstall
* linkerd multicluster install
* linkerd multicluster prune
* linkerd multicluster uninstall
* linkerd jaeger install
* linkerd jaeger prune
* linkerd jaeger uninstall
Signed-off-by: Alex Leong <alex@buoyant.io>
Because extension label values have been changed, an older install of an extension will fail to be uninstalled with a more recent CLI version. This is because the uninstall command checks the new label value which doesn't match older installs.
This small change fixes that by checking both -- the new, non-prefixed version and the old prefixed one. The bug should have a relatively small impact since there are only a few edge releases that contain the prefixed label value (an exception being stable-2.10.0 which used the prefixed version still).
Signed-off-by: Matei David <matei@buoyant.io>
Fixes#5994
When running an uninstall command for Linkerd or a Linkerd extension and there are no resources to delete the command silently exits and prints no output. This can be confusing.
We update the uninstall commands to print an error message to stderr if there are no resources to delete. Since this message is printed to stderr instead of stdout, it does not interfere with piping the output to kubectl.
```console
> linkerd viz uninstall | kubectl delete -f -
No resources found to uninstall
No resources found
```
Signed-off-by: Alex Leong <alex@buoyant.io>
* Remove linkerd prefix from extension resources
This change removes the `linkerd-` prefix on all non-cluster resources
in the jaeger and viz linkerd extensions. Removing the prefix makes all
linkerd extensions consistent in their naming.
Signed-off-by: Dennis Adjei-Baah <dennis@buoyant.io>
Add a `linkerd jaeger uninstall` command which prints the linkerd-jaeger extension resources so that they can be deleted. This is similar to the `linkerd uninstall` command.
```
> bin/linkerd jaeger uninstall | k delete -f -
clusterrole.rbac.authorization.k8s.io "linkerd-jaeger-linkerd-jaeger-proxy-mutator" deleted
clusterrolebinding.rbac.authorization.k8s.io "linkerd-jaeger-linkerd-jaeger-proxy-mutator" deleted
mutatingwebhookconfiguration.admissionregistration.k8s.io "linkerd-proxy-mutator-webhook-config" deleted
namespace "linkerd-jaeger" deleted
```
Signed-off-by: Alex Leong <alex@buoyant.io>