From a6461d2d79951a55db079d44237904082f05f6b2 Mon Sep 17 00:00:00 2001 From: Elad Leev Date: Tue, 30 Jul 2024 20:14:24 +0100 Subject: [PATCH] fix(kubectl): change cache to 0 by default --- src/segments/kubectl.go | 2 +- website/docs/segments/cli/kubectl.mdx | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/segments/kubectl.go b/src/segments/kubectl.go index fac9eaec5575..a3dc1c4f1f81 100644 --- a/src/segments/kubectl.go +++ b/src/segments/kubectl.go @@ -76,7 +76,7 @@ func (k *Kubectl) restoreCacheValue() error { } func (k *Kubectl) Enabled() bool { - cacheTimeout := k.props.GetInt(properties.CacheTimeout, 1) + cacheTimeout := k.props.GetInt(properties.CacheTimeout, 0) if cacheTimeout > 0 { if err := k.restoreCacheValue(); err == nil { diff --git a/website/docs/segments/cli/kubectl.mdx b/website/docs/segments/cli/kubectl.mdx index 979cb3404c07..93b5f2dfec44 100644 --- a/website/docs/segments/cli/kubectl.mdx +++ b/website/docs/segments/cli/kubectl.mdx @@ -8,10 +8,6 @@ sidebar_label: Kubernetes Display the currently active Kubernetes context name and namespace name. -:::caution -The Kubernetes context is cached for 1 minute by default. To avoid caching, set `cache_timeout` to 0. -::: - ## Sample Configuration import Config from "@site/src/components/Config.js"; @@ -39,7 +35,7 @@ import Config from "@site/src/components/Config.js"; | `display_error` | `boolean` | `false` | show the error context when failing to retrieve the kubectl information | | `parse_kubeconfig` | `boolean` | `false` | parse kubeconfig files instead of calling out to kubectl to improve performance | | `context_aliases` | `object` | | custom context namespace | -| `cache_timeout` | `int` | `1` | in minutes - how long is the context cached | +| `cache_timeout` | `int` | `0` | in minutes - how long is the context cached | ## Template ([info][templates])