Skip to content
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

kubens select and switch take too long #216

Closed
aduong opened this issue May 4, 2020 · 3 comments · Fixed by #236
Closed

kubens select and switch take too long #216

aduong opened this issue May 4, 2020 · 3 comments · Fixed by #236

Comments

@aduong
Copy link

aduong commented May 4, 2020

When using kubens $ns and kubens -, it's taking over ten seconds. This is caused by the relisting of namespaces, of which I have at least thousands. It'd be nice if this could be sped up, either by allowing me to disable the existence check or caching the namespaces.

@ahmetb
Copy link
Owner

ahmetb commented May 4, 2020

Oh man you might be the only person with thousands of namespaces. This sounds a lot like #83 which is reinforcing the point that we should probably implement.

@aduong
Copy link
Author

aduong commented May 4, 2020

#83 is similar, but I do have permissions to list namespaces and I appreciate autocomplete, interactive listing & choosing (via fzf) every so often. Here are some concrete cases where I don't need the namespace check:

  • Using a kubens X from my shell history. The check has already been done in the past and generally namespaces don't get deleted.
  • Using kubens -

I think one possible tweak is to replace the list check with a get check, i.e. instead of grep -q ^"${1}"\$ <(get_namespaces), do a $KUBECTL get namespace "${1}" and interpret the result/status of that.

@ahmetb
Copy link
Owner

ahmetb commented May 4, 2020

Yeah, that makes perfect sense. It's likely we’ll fix this in the Go implementation. So I recommend you fork the bash implementation and use yourself in the meanwhile. Thanks for bringing it up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants