Feature/default_view (#2866)
* initialView * Removed log msg * fix: tests * fix: rename to defaultView * docs: add defaultView setting to READMEmine
parent
fbd2a0250a
commit
c2694ee3e5
|
|
@ -415,6 +415,8 @@ You can now override the context portForward default address configuration by se
|
||||||
maxConnRetry: 5
|
maxConnRetry: 5
|
||||||
# Indicates whether modification commands like delete/kill/edit are disabled. Default is false
|
# Indicates whether modification commands like delete/kill/edit are disabled. Default is false
|
||||||
readOnly: false
|
readOnly: false
|
||||||
|
# This setting allows users to specify the default view, but it is not set by default.
|
||||||
|
defaultView: ""
|
||||||
# Toggles whether k9s should exit when CTRL-C is pressed. When set to true, you will need to exit k9s via the :quit command. Default is false.
|
# Toggles whether k9s should exit when CTRL-C is pressed. When set to true, you will need to exit k9s via the :quit command. Default is false.
|
||||||
noExitOnCtrlC: false
|
noExitOnCtrlC: false
|
||||||
#UI settings
|
#UI settings
|
||||||
|
|
|
||||||
|
|
@ -113,6 +113,10 @@ func run(*cobra.Command, []string) error {
|
||||||
slog.Warn("Fail to load global/context configuration", slogs.Error, err)
|
slog.Warn("Fail to load global/context configuration", slogs.Error, err)
|
||||||
}
|
}
|
||||||
app := view.NewApp(cfg)
|
app := view.NewApp(cfg)
|
||||||
|
if app.Config.K9s.DefaultView != "" {
|
||||||
|
app.Config.SetActiveView(app.Config.K9s.DefaultView)
|
||||||
|
}
|
||||||
|
|
||||||
if err := app.Init(version, *k9sFlags.RefreshRate); err != nil {
|
if err := app.Init(version, *k9sFlags.RefreshRate); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,7 @@
|
||||||
"noExitOnCtrlC": { "type": "boolean" },
|
"noExitOnCtrlC": { "type": "boolean" },
|
||||||
"skipLatestRevCheck": { "type": "boolean" },
|
"skipLatestRevCheck": { "type": "boolean" },
|
||||||
"disablePodCounting": { "type": "boolean" },
|
"disablePodCounting": { "type": "boolean" },
|
||||||
|
"defaultView": { "type": "string" },
|
||||||
"portForwardAddress": { "type": "string" },
|
"portForwardAddress": { "type": "string" },
|
||||||
"ui": {
|
"ui": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,7 @@ type K9s struct {
|
||||||
ImageScans ImageScans `json:"imageScans" yaml:"imageScans"`
|
ImageScans ImageScans `json:"imageScans" yaml:"imageScans"`
|
||||||
Logger Logger `json:"logger" yaml:"logger"`
|
Logger Logger `json:"logger" yaml:"logger"`
|
||||||
Thresholds Threshold `json:"thresholds" yaml:"thresholds"`
|
Thresholds Threshold `json:"thresholds" yaml:"thresholds"`
|
||||||
|
DefaultView string `json:"defaultView" yaml:"defaultView"`
|
||||||
manualRefreshRate int
|
manualRefreshRate int
|
||||||
manualReadOnly *bool
|
manualReadOnly *bool
|
||||||
manualCommand *string
|
manualCommand *string
|
||||||
|
|
@ -113,6 +114,7 @@ func (k *K9s) Merge(k1 *K9s) {
|
||||||
}
|
}
|
||||||
|
|
||||||
k.LiveViewAutoRefresh = k1.LiveViewAutoRefresh
|
k.LiveViewAutoRefresh = k1.LiveViewAutoRefresh
|
||||||
|
k.DefaultView = k1.DefaultView
|
||||||
k.ScreenDumpDir = k1.ScreenDumpDir
|
k.ScreenDumpDir = k1.ScreenDumpDir
|
||||||
k.RefreshRate = k1.RefreshRate
|
k.RefreshRate = k1.RefreshRate
|
||||||
k.MaxConnRetry = k1.MaxConnRetry
|
k.MaxConnRetry = k1.MaxConnRetry
|
||||||
|
|
|
||||||
|
|
@ -43,3 +43,4 @@ k9s:
|
||||||
memory:
|
memory:
|
||||||
critical: 90
|
critical: 90
|
||||||
warn: 70
|
warn: 70
|
||||||
|
defaultView: ""
|
||||||
|
|
|
||||||
|
|
@ -43,3 +43,4 @@ k9s:
|
||||||
memory:
|
memory:
|
||||||
critical: 90
|
critical: 90
|
||||||
warn: 70
|
warn: 70
|
||||||
|
defaultView: ""
|
||||||
|
|
|
||||||
|
|
@ -43,3 +43,4 @@ k9s:
|
||||||
memory:
|
memory:
|
||||||
critical: 90
|
critical: 90
|
||||||
warn: 70
|
warn: 70
|
||||||
|
defaultView: ""
|
||||||
|
|
|
||||||
|
|
@ -39,3 +39,4 @@ k9s:
|
||||||
memory:
|
memory:
|
||||||
critical: 90
|
critical: 90
|
||||||
warn: 70
|
warn: 70
|
||||||
|
defaultView: ""
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue