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 <matt.fisher@microsoft.com>
pull/6486/head
Matthew Fisher 5 years ago
parent d95a6246a4
commit 1b0b843d6a
No known key found for this signature in database
GPG Key ID: 92AA783CBAAE8E3B

@ -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")

Loading…
Cancel
Save