* feat: add autoRefresh config field Add autoRefresh: true to config test scenarios Update all instances of NewLiveView() to pass autoRefresh config value to LiveView * fix: rename generic autoRefresh config field to liveViewAutoRefresh * docs: document liveViewAutoRefresh config field * fix: use app config for NewLiveView creation --------- Co-authored-by: Artem Gorbatiuk <wfrced@gmail.com>mine
parent
68afb3d9ef
commit
a34d7ae6bf
|
|
@ -319,6 +319,8 @@ K9s uses aliases to navigate most K8s resources.
|
||||||
```yaml
|
```yaml
|
||||||
# $XDG_CONFIG_HOME/k9s/config.yml
|
# $XDG_CONFIG_HOME/k9s/config.yml
|
||||||
k9s:
|
k9s:
|
||||||
|
# Enable periodic refresh of resource browser windows. Default false
|
||||||
|
liveViewAutoRefresh: false
|
||||||
# Represents ui poll intervals. Default 2secs
|
# Represents ui poll intervals. Default 2secs
|
||||||
refreshRate: 2
|
refreshRate: 2
|
||||||
# Number of retries once the connection to the api-server is lost. Default 15.
|
# Number of retries once the connection to the api-server is lost. Default 15.
|
||||||
|
|
|
||||||
|
|
@ -277,6 +277,7 @@ func (m *mockSettings) ClusterNames() (map[string]struct{}, error) { return nil,
|
||||||
// Test Data...
|
// Test Data...
|
||||||
|
|
||||||
var expectedConfig = `k9s:
|
var expectedConfig = `k9s:
|
||||||
|
liveViewAutoRefresh: true
|
||||||
refreshRate: 100
|
refreshRate: 100
|
||||||
maxConnRetry: 5
|
maxConnRetry: 5
|
||||||
enableMouse: false
|
enableMouse: false
|
||||||
|
|
@ -376,6 +377,7 @@ var expectedConfig = `k9s:
|
||||||
`
|
`
|
||||||
|
|
||||||
var resetConfig = `k9s:
|
var resetConfig = `k9s:
|
||||||
|
liveViewAutoRefresh: true
|
||||||
refreshRate: 2
|
refreshRate: 2
|
||||||
maxConnRetry: 5
|
maxConnRetry: 5
|
||||||
enableMouse: false
|
enableMouse: false
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@ const (
|
||||||
|
|
||||||
// K9s tracks K9s configuration options.
|
// K9s tracks K9s configuration options.
|
||||||
type K9s struct {
|
type K9s struct {
|
||||||
|
LiveViewAutoRefresh bool `yaml:"liveViewAutoRefresh"`
|
||||||
RefreshRate int `yaml:"refreshRate"`
|
RefreshRate int `yaml:"refreshRate"`
|
||||||
MaxConnRetry int `yaml:"maxConnRetry"`
|
MaxConnRetry int `yaml:"maxConnRetry"`
|
||||||
EnableMouse bool `yaml:"enableMouse"`
|
EnableMouse bool `yaml:"enableMouse"`
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
k9s:
|
k9s:
|
||||||
|
liveViewAutoRefresh: true
|
||||||
refreshRate: 2
|
refreshRate: 2
|
||||||
readOnly: false
|
readOnly: false
|
||||||
logger:
|
logger:
|
||||||
|
|
|
||||||
|
|
@ -48,6 +48,7 @@ func NewLiveView(app *App, title string, m model.ResourceViewer) *LiveView {
|
||||||
maxRegions: 0,
|
maxRegions: 0,
|
||||||
cmdBuff: model.NewFishBuff('/', model.FilterBuffer),
|
cmdBuff: model.NewFishBuff('/', model.FilterBuffer),
|
||||||
model: m,
|
model: m,
|
||||||
|
autoRefresh: app.Config.K9s.LiveViewAutoRefresh,
|
||||||
}
|
}
|
||||||
v.AddItem(v.text, 0, 1, true)
|
v.AddItem(v.text, 0, 1, true)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue