From 31b5df4c30780c95368693354b30498855818b5e Mon Sep 17 00:00:00 2001 From: Chanwit Kaewkasi Date: Thu, 9 Sep 2021 16:18:43 +0700 Subject: [PATCH] fix context listing bug We were using the wrong field, c.Cluster, which is the cluster name. The context name is actually the key portion of rules.Contexts map. Signed-off-by: Chanwit Kaewkasi --- main.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index af39a9f..48140c3 100644 --- a/main.go +++ b/main.go @@ -35,8 +35,8 @@ func initialContexts() (contexts []string, currentCtx string, err error) { return contexts, currentCtx, err } - for _, c := range rules.Contexts { - contexts = append(contexts, c.Cluster) + for contextName := range rules.Contexts { + contexts = append(contexts, contextName) } return contexts, rules.CurrentContext, nil