headlamp-k8s / headlamp

A Kubernetes web UI that is fully-featured, user-friendly and extensible
https://headlamp.dev
Apache License 2.0
2.21k stars 155 forks source link

backend: Refactor headlamp.go refreshAndCacheNewToken to be shorter #1848

Open illume opened 7 months ago

illume commented 7 months ago

This function needs to be shorter to reduce the complexity of it, and make it easier to understand. Perhaps it should be 2 or more functions.

Currently the code turns off the linter for this issue with "//nolint:funlen".



Related umbrella backend refactoring clean up issue https://github.com/headlamp-k8s/headlamp/issues/855 (other pieces of code have the linter disabled and could also be fixed up, feel free to refactor a different function.)

CroWzblooD commented 3 months ago

Is it still availabl,e I would like to give a try