From 1b0b843d6a771c3ec14e59df3074e2d077cf32ae Mon Sep 17 00:00:00 2001 From: Matthew Fisher Date: Mon, 23 Sep 2019 16:37:40 -0700 Subject: [PATCH] fix(action): invalidate discovery client cache on startup we want to force a cache invalidation to ensure that the Capabilities object always has the latest information from the server (Kubernetes server version, available API versions, etc). `kubectl version` forces a cache invalidation every time it's invoked, so this seems like a safe change that is identical to kubectl's behaviour. Signed-off-by: Matthew Fisher --- pkg/action/action.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkg/action/action.go b/pkg/action/action.go index 7ae18779f..f5ba24ba7 100644 --- a/pkg/action/action.go +++ b/pkg/action/action.go @@ -91,6 +91,8 @@ func (c *Configuration) getCapabilities() (*chartutil.Capabilities, error) { if err != nil { return nil, errors.Wrap(err, "could not get Kubernetes discovery client") } + // force a discovery cache invalidation to always fetch the latest server version/capabilities. + dc.Invalidate() kubeVersion, err := dc.ServerVersion() if err != nil { return nil, errors.Wrap(err, "could not get server version from Kubernetes")