derailed / k9s

🐶 Kubernetes CLI To Manage Your Clusters In Style!
https://k9scli.io
Apache License 2.0
26.5k stars 1.66k forks source link

want a auto update cli command #2404

Open DVKunion opened 8 months ago

DVKunion commented 8 months ago




Is your feature request related to a problem? Please describe. none

Describe the solution you'd like Every time I open my k9s, the page will inform me of the latest version.

image

But there was no update command provided, so I needed to download the distribution myself (most likely from the GitHub release page).

image

I was wondering if I could provide a cli command such as k9s update to automatically download and replace the executable file from GitHub release, instead of repeating manual downloads and uploads on different servers.

Describe alternatives you've considered Add an update command in cli to try downloading and updating local binary files from github release.

Maybe like this: k9s update $version

Additional context If feasible, I can provide a PR for this :)

derailed commented 8 months ago

@DVKunion Sounds great! PR on this would be welcomed. Thank you!

slimus commented 8 months ago

@DVKunion @derailed I already started and implemented this command. Please review and help with some testing :) Thanks! https://github.com/derailed/k9s/pull/2412/files

DVKunion commented 8 months ago

@DVKunion @derailed I already started and implemented this command. Please review and help with some testing :) Thanks! https://github.com/derailed/k9s/pull/2412/files

wow~ so quick ! Is it reliable to use the go-selfupdate third-party package to implement this feature? I didn't carefully check the code of this library and just got 34 starts? By the way, in internal/model/cluster_info. go, an internal method for querying the latest version has also been implemented, and I originally intended to extract it together.

DVKunion commented 8 months ago

I'm a security engineer, so I feel sensitive to operations such as introducing external libraries sometimes :(

slimus commented 8 months ago

@DVKunion thanks for your comment. To be honest I also didn't check their code. Your comment totally make sense. This project already has implementation for different systems and supports goreleaser format, that's why I use it. But if you find something weird or just think we should implement this command without external package - I can start from the scratch :)

DVKunion commented 8 months ago

To be honest, both of these methods are actually acceptable because it is just an update command, and it is indeed a bit troublesome to implement adaptation to different operating systems on your own. If there is enough time, it would be better to implement it on your own, after all, once such a library encounters problems or no longer exists, it may be an additional cost; But for me, as long as it works :)