From 2cb7116fae1db91601926a429a1be6d690b1c480 Mon Sep 17 00:00:00 2001 From: Gustavo Paiva Date: Wed, 23 Oct 2019 23:01:41 -0300 Subject: [PATCH] invalidate cache when switching context --- internal/k8s/api.go | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/k8s/api.go b/internal/k8s/api.go index 459777ee..7294c7d3 100644 --- a/internal/k8s/api.go +++ b/internal/k8s/api.go @@ -332,6 +332,7 @@ func (a *APIClient) SwitchContextOrDie(ctx string) { } if currentCtx != ctx { + a.cachedDiscovery = nil a.reset() if err := a.config.SwitchContext(ctx); err != nil { panic(err)