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
|
||||
# Indicates whether modification commands like delete/kill/edit are disabled. Default is 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.
|
||||
noExitOnCtrlC: false
|
||||
#UI settings
|
||||
|
|
|
|||
|
|
@ -113,6 +113,10 @@ func run(*cobra.Command, []string) error {
|
|||
slog.Warn("Fail to load global/context configuration", slogs.Error, err)
|
||||
}
|
||||
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 {
|
||||
return err
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@
|
|||
"noExitOnCtrlC": { "type": "boolean" },
|
||||
"skipLatestRevCheck": { "type": "boolean" },
|
||||
"disablePodCounting": { "type": "boolean" },
|
||||
"defaultView": { "type": "string" },
|
||||
"portForwardAddress": { "type": "string" },
|
||||
"ui": {
|
||||
"type": "object",
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@ type K9s struct {
|
|||
ImageScans ImageScans `json:"imageScans" yaml:"imageScans"`
|
||||
Logger Logger `json:"logger" yaml:"logger"`
|
||||
Thresholds Threshold `json:"thresholds" yaml:"thresholds"`
|
||||
DefaultView string `json:"defaultView" yaml:"defaultView"`
|
||||
manualRefreshRate int
|
||||
manualReadOnly *bool
|
||||
manualCommand *string
|
||||
|
|
@ -113,6 +114,7 @@ func (k *K9s) Merge(k1 *K9s) {
|
|||
}
|
||||
|
||||
k.LiveViewAutoRefresh = k1.LiveViewAutoRefresh
|
||||
k.DefaultView = k1.DefaultView
|
||||
k.ScreenDumpDir = k1.ScreenDumpDir
|
||||
k.RefreshRate = k1.RefreshRate
|
||||
k.MaxConnRetry = k1.MaxConnRetry
|
||||
|
|
|
|||
|
|
@ -43,3 +43,4 @@ k9s:
|
|||
memory:
|
||||
critical: 90
|
||||
warn: 70
|
||||
defaultView: ""
|
||||
|
|
|
|||
|
|
@ -43,3 +43,4 @@ k9s:
|
|||
memory:
|
||||
critical: 90
|
||||
warn: 70
|
||||
defaultView: ""
|
||||
|
|
|
|||
|
|
@ -43,3 +43,4 @@ k9s:
|
|||
memory:
|
||||
critical: 90
|
||||
warn: 70
|
||||
defaultView: ""
|
||||
|
|
|
|||
|
|
@ -39,3 +39,4 @@ k9s:
|
|||
memory:
|
||||
critical: 90
|
||||
warn: 70
|
||||
defaultView: ""
|
||||
|
|
|
|||
Loading…
Reference in New Issue