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

get-token --login azurecli should be fast when a local token exists #358

Open
enj opened this issue Nov 3, 2023 · 2 comments
Open

get-token --login azurecli should be fast when a local token exists #358

enj opened this issue Nov 3, 2023 · 2 comments

Comments

@enj
Copy link
Member

enj commented Nov 3, 2023

Currently it takes 500ms to get a locally cached token when --login azurecli is used:

$ time kubelogin get-token --login azurecli --server-id _val_ 1> /dev/null
real	0m0.508s
user	0m0.223s
sys	0m0.122s

This is likely caused by the token cache being disabled for azurecli in #142 (to address #137). Instead of disabling caching altogether, I propose a middle ground - cache azurecli tokens for 10s (which the same length as the Kube API server's internal token cache). This will keep the majority of kubectl calls from being slow.

@enj
Copy link
Member Author

enj commented Nov 3, 2023

Locally I did git revert 7252d376 to drop 7252d37 and now calls are 10x faster:

$ time kubelogin get-token --login azurecli --server-id _val_ 1> /dev/null

real	0m0.061s
user	0m0.016s
sys	0m0.022s

@lennartack
Copy link

I need faster requests for tab completion, so I hope this can be fixed.

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

No branches or pull requests

2 participants