From d3b917a8a92b672c185a051d28587f163f80426c Mon Sep 17 00:00:00 2001 From: c-bata Date: Mon, 2 Dec 2019 13:12:22 +0900 Subject: [PATCH] Fix the bug of context list has a blank item --- kube/resource.go | 1 + 1 file changed, 1 insertion(+) diff --git a/kube/resource.go b/kube/resource.go index a2d6ce2..8578fca 100644 --- a/kube/resource.go +++ b/kube/resource.go @@ -138,6 +138,7 @@ func fetchContextList() { } updateLastFetchedAt(key) r := ExecuteAndGetResult("config get-contexts --no-headers -o name") + r = strings.TrimRight(r, "\n") contextList.Store(strings.Split(r, "\n")) }