-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/default_view #2866
base: master
Are you sure you want to change the base?
Feature/default_view #2866
Conversation
Created a new pull request, because I messed up my git. |
Hello there! Thank you for your PR and your work on k9s! There is already a way of setting active views per cluster - in the cluster specific configuration file ( k9s:
[...]
view:
active: po The problem here is: the value for the cluster specific config is automatically generated and sets the view to a default value (I think So to implement the @derailed I think your input is required here as to make a decision how to proceed with this feature. |
@KevinGimbel I believe this behavior corresponds to the last active view for the cluster/context. By default, K9s always starts in the last active view unless the The changes proposed in this PR don't alter that behavior:
|
@derailed have you had a chance to look at this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@uozalp Yes I think this make sense. I was actually thinking we should rename this defaultView since it is the fallback to either ignore the cli arg or the last stored view when set. What do you think?
@uozalp Also looks like we have some conflicts. Can you take a peek? Thank you! |
@derailed I have renamed it to |
I personally prefer the current behavior since we manage multiple clusters, and I like starting in the That said, there are cases where you might have a command like:
saved in your shell history. If you do a quick reverse search, you’d still want that command to take precedence, even if a default view is configured. |
This pull request introduces a new configuration setting called
initialView
that allows users to specify the initial view in the application. The changes span across multiple files to integrate this new setting into the application logic, configuration, and documentation.Configuration and Documentation Updates:
README.md
: Added a description of theinitialView
setting to the configuration section.internal/config/json/schemas/k9s.json
: AddedinitialView
as a new string type configuration option.Application Logic Updates:
cmd/root.go
: Modified therun
function to set the active view based on theinitialView
configuration if it is specified.internal/config/k9s.go
:InitialView
as a new field in theK9s
struct.Merge
method to include merging theInitialView
field.