You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
add an option to only show context name in set cmd #48
Hi @golgoth31 thank you for submittinga feature request and also the PR. I am currently trying to understand the idea behind this better.
Is this just related to removing the name of the cluster from the output to make it look nicer? I am imagining a situation where the cluster name is randomly generated like GKE does.
Or in the long-run do you also want the tab-completion of commands to change?
Hi,
the idea is to only show the full name of the context. In GKE for example, the context name is not so random but pretty long. In the tabular view as built by default, all my context are quite the same due to truncation so almost unusable. I also should say that I don't need to know the cluster name nor the config file used.
We could had the tab completion in the future but it was not the primary use case.
You can't tell the difference between the two rows starting with arn:aws:eks:us-east-1:841 nor the ones starting with ev-sandbox-usinfdevranch. It would be nice to show just the name of the file in the store directory (without the store directory itself since it's redundant).
@sourcedelica Ah okay now I understand. Thanks for the input.
I am currently debating with myself between a couple of options, which are also combinable:
a) Implement a shortening algorithm for similar contexts and clusters
Could be something that checks of all of the contexts and clusters if a beginning substring matches and then shortens the display. For example arn:aws:eks:us-east-1:841abc and arn:aws:eks:us-east-1:841xyz have 25 characters that match and our display is 25 characters. We could then say that the min prefix length is 8 characters and the "..." is 3 characters. This results in the suffix being 14 characters. This would then result in something like this.
$ konf set
Use the arrow keys to navigate: ↓ ↑ → ← and / toggles search
? Context | Cluster | File :
▸ arn:aws:...-east-1:116abc | arn:aws:eks:us-east-1:116 | /home/eric/.kube/konfs/st |
arn:aws:...-east-1:223xyz | arn:aws:eks:us-east-1:223 | /home/eric/.kube/konfs/st |
b) We could make the length of the columns configurable
I think this could make a lot of sense, so any user can choose the width that suits them best. I would need to build a config-file mechanism to make this work, but I think that is only a matter of time until config file is needed.
c) Shorten the output of the File column
We could possibly change the display to just say $KONFDIR. This would result in something like this
$ konf set
Use the arrow keys to navigate: ↓ ↑ → ← and / toggles search
? Context | Cluster | File :
▸ arn:aws:eks:us-east-1:116 | arn:aws:eks:us-east-1:116 | $KONFDIR/store/<name> |
arn:aws:eks:us-east-1:223 | arn:aws:eks:us-east-1:223 | $KONFDIR/store/<name> |
Just to share my thoughts for now, I have not decided what option to pursue.
For a) would it check all pairs to see which ones have common prefixes? Seems complicated.
What would work best for me is the original idea in this issue where you could have an option to only select from the full context name. The chooser would be one long column.
Re: config file - for this one it would be nice if you could select it with an environment variable. That way I could keep the super friendly konf set as the command.
Activity
[-]add an option to only show cluster name in set cmd[/-][+]add an option to only show context name in set cmd[/+]SimonTheLeg commentedon Feb 14, 2023
Hi @golgoth31 thank you for submittinga feature request and also the PR. I am currently trying to understand the idea behind this better.
Is this just related to removing the name of the cluster from the output to make it look nicer? I am imagining a situation where the cluster name is randomly generated like GKE does.
Or in the long-run do you also want the tab-completion of commands to change?
golgoth31 commentedon Feb 14, 2023
Hi,
the idea is to only show the full name of the context. In GKE for example, the context name is not so random but pretty long. In the tabular view as built by default, all my context are quite the same due to truncation so almost unusable. I also should say that I don't need to know the cluster name nor the config file used.
We could had the tab completion in the future but it was not the primary use case.
sourcedelica commentedon Apr 9, 2023
Here's an example:
You can't tell the difference between the two rows starting with
arn:aws:eks:us-east-1:841nor the ones starting withev-sandbox-usinfdevranch. It would be nice to show just the name of the file in the store directory (without the store directory itself since it's redundant).SimonTheLeg commentedon Apr 11, 2023
@sourcedelica Ah okay now I understand. Thanks for the input.
I am currently debating with myself between a couple of options, which are also combinable:
a) Implement a shortening algorithm for similar contexts and clusters
Could be something that checks of all of the contexts and clusters if a beginning substring matches and then shortens the display. For example
arn:aws:eks:us-east-1:841abcandarn:aws:eks:us-east-1:841xyzhave 25 characters that match and our display is 25 characters. We could then say that the min prefix length is 8 characters and the "..." is 3 characters. This results in the suffix being 14 characters. This would then result in something like this.b) We could make the length of the columns configurable
I think this could make a lot of sense, so any user can choose the width that suits them best. I would need to build a config-file mechanism to make this work, but I think that is only a matter of time until config file is needed.
c) Shorten the output of the File column
We could possibly change the display to just say $KONFDIR. This would result in something like this
Just to share my thoughts for now, I have not decided what option to pursue.
sourcedelica commentedon Apr 11, 2023
Some more data points - here's the full name of a few of my EKS contexts:
Here's the filenames of those in ~/.kube/konfs/store: 😄
For a) would it check all pairs to see which ones have common prefixes? Seems complicated.
What would work best for me is the original idea in this issue where you could have an option to only select from the full context name. The chooser would be one long column.
Re: config file - for this one it would be nice if you could select it with an environment variable. That way I could keep the super friendly
konf setas the command.