From 3543575e64b7f2793e8e568d37b8d5212a383492 Mon Sep 17 00:00:00 2001 From: Matei-Marius Micu Date: Fri, 15 May 2020 01:32:27 +0300 Subject: [PATCH] Document alias parameter --- README.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 671bbf9..7a4db75 100644 --- a/README.md +++ b/README.md @@ -108,4 +108,13 @@ The logic is implemented [here](./internal/kubeconfig/kubeconfig.go) in `IsExpor The basic idea is: - we have a cluster in kubeconfig with the same endpoint - - that cluster is referenced in a `context` block (see [Organizing Cluster Access Using kubeconfig Files](https://kubernetes.io/docs/concepts/configuration/organize-cluster-access-kubeconfig/#context)) + - that cluster is referenced in a `context` block (see [Organizing Cluster Access Using kubeconfig Files][kubeconfig-context]) + + +### Configur context name with `--context-name-alias` + +The [kubeconfig context][kubeconfig-context] is used to identify a cluster and user pair, with the `--context-name-alias` you can provide a go template that will be +used to generate the name of the context. In the template you have access to the [Cluster struct](https://github.com/mateimicu/kdiscover/blob/master/internal/cluster/cluster.go#L23). The default template is `{{.Name}}`. + + +[kubeconfig-context]: https://kubernetes.io/docs/concepts/configuration/organize-cluster-access-kubeconfig/#context