We add a new v1alpha3 resource version to the Link custom resource. This version adds `excludedAnnotations` and `excludedLabels` fields to the spec which will be used to exclude labels and annotations from being copied onto mirror and federated services.
Signed-off-by: Alex Leong <alex@buoyant.io>
The linkerd-multicluster extension uses client-go's `unstructured` API to access Link custom resources. This API allowed us to develop quickly without the work of generating typed bindings. However, using the unstrucutred API is error prone since fields must be accessed by their string name. It is also inconsistent with the rest of the project which uses typed bindings.
We replace the use of the unstructured API for Link resources with generated typed bindings. The client-go APIs are slightly different and client-go does not provide a way to update subresources for typed bindings. Therefore, when updating a Link's status subresource, we use a patch instead of an update.
Signed-off-by: Alex Leong <alex@buoyant.io>
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>
Problem
If the main Linkerd control plane has been uninstalled, it is no longer possible to uninstall the multicluster extension.
```
$ bin/linkerd mc uninstall | k delete -f -
Error: you need Linkerd to be installed in order to install multicluster addons
Usage:
linkerd multicluster uninstall [flags]
```
Solution
Fetch resources with the label `linkerd.io/extension: linkerd-multicluster` and delete them
Closes#5624
Signed-off-by: Piyush Singariya <piyushsingariya@gmail.com>
Fixes#5257
This branch movies mc charts and cli level code to a new
top level directory. None of the logic is changed.
Also, moves some common types into `/pkg` so that they
are accessible both to the main cli and extensions.
Signed-off-by: Tarun Pothulapati <tarunpothulapati@outlook.com>