teleport/tool/tsh
Tiago Silva 4da3e820ad
Deduplicate resources for tsh request search when replicas>1 (#28661)
When the number of replicas of a resource is bigger than 1 - i.e.
`kube_cluster`, `app`, `db` - `tsh request search` printed
all the registered resources instead of ignoring the repeated rows.

This PR excludes the repeated resource ids from the table and request
command.

Before:
```
$ tsh request search --kind kube_cluster
Name       Hostname Labels                                                             Resource ID
---------- -------- ------------------------------------------------------------------ -----------------------------------
local               env=tiago                                                          /tele.local/kube_cluster/local
my-cluster          teleport.internal/resource-id=89b78b53-600f-4545-922c-96d20ee15182 /tele.local/kube_cluster/my-cluster
my-cluster          teleport.internal/resource-id=89b78b53-600f-4545-922c-96d20ee15182 /tele.local/kube_cluster/my-cluster
my-cluster          teleport.internal/resource-id=89b78b53-600f-4545-922c-96d20ee15182 /tele.local/kube_cluster/my-cluster

To request access to these resources, run
> tsh request create --resource /tele.local/kube_cluster/local --resource /tele.local/kube_cluster/my-cluster --resource /tele.local/kube_cluster/my-cluster --resource /tele.local/kube_cluster/my-cluster \
    --reason <request reason>

```

After:

```
$ tsh request search --kind kube_cluster
Name       Hostname Labels                                                             Resource ID
---------- -------- ------------------------------------------------------------------ -----------------------------------
local               env=tiago                                                          /tele.local/kube_cluster/local
my-cluster          teleport.internal/resource-id=89b78b53-600f-4545-922c-96d20ee15182 /tele.local/kube_cluster/my-cluster

To request access to these resources, run
> tsh request create --resource /tele.local/kube_cluster/local --resource /tele.local/kube_cluster/my-cluster \
    --reason <request reason>

```
2023-07-10 13:55:55 +00:00
..
common Deduplicate resources for tsh request search when replicas>1 (#28661) 2023-07-10 13:55:55 +00:00
main.go Add tsh e2e tests with various security features enabled (#26862) 2023-06-06 01:25:09 +00:00