fix(kubectl): change cache to 0 by default

This commit is contained in:
Elad Leev 2024-07-30 20:14:24 +01:00 committed by Jan De Dobbeleer
parent 69f6982e2c
commit a6461d2d79
2 changed files with 2 additions and 6 deletions

View file

@ -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 {

View file

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