Skip to content

Commit

Permalink
fix(kubectl): change cache to 0 by default
Browse files Browse the repository at this point in the history
  • Loading branch information
EladLeev authored and JanDeDobbeleer committed Jul 30, 2024
1 parent 69f6982 commit a6461d2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/segments/kubectl.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
6 changes: 1 addition & 5 deletions website/docs/segments/cli/kubectl.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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])

Expand Down

0 comments on commit a6461d2

Please sign in to comment.