kubel
kubel copied to clipboard
Remove multiple setq calls to tabulated-list-sort-key
We current set the variable tabulated-list-sort-key multiple times. This isn't really needed.
Thank you for catching this! I can't remember why we do that. I feel like having a sort key is better than not having one. The risk though is that for some resource the first column isn't NAME
. I did some local testing with pod/services/secrets/nodes/deployments and didn't see any issues though. Maybe the solution is to remove (setq tabulated-list-sort-key nil)
? Or even better to dynamically pass a sort key?
I feel like having a sort key is better than not having one. The risk though is that for some resource the first column isn't NAME.
Yeah, agree.
I did some local testing with pod/services/secrets/nodes/deployments and didn't see any issues though. Maybe the solution is to remove (setq tabulated-list-sort-key nil)?
The default behavior I would want is to have a non sorted thing. But I guess we can make optionally configurable with the default value of nil
?
Or even better to dynamically pass a sort key?
What do you mean by this ? You mean some interactive function to set the sort key ?
I did some local testing with pod/services/secrets/nodes/deployments and didn't see any issues though. Maybe the solution is to remove (setq tabulated-list-sort-key nil)?
The default behavior I would want is to have a non sorted thing. But I guess we can make optionally configurable with the default value of
nil
?
RIght now the default is to let kubectl
output dictate the order (which I believe is always sorted alphabetically on the first column). The advantage to having a sort key is that it lets Emacs do some more work rather than pass arguments to kubectl
. There are no disadvantages aside from potentially a bug if the first column returned from the kubectl
command isn't call NAME
.
Or even better to dynamically pass a sort key?
What do you mean by this ? You mean some interactive function to set the sort key ?
Yeah the column names are dynamically generated based on the output of the kubectl
command for the given resource. And the output is always sorted based on first column. A nice feature would be to always make the first column name the sort key.