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

Have kubelogin update itself #44

Open
ghost opened this issue Jan 12, 2018 · 1 comment
Open

Have kubelogin update itself #44

ghost opened this issue Jan 12, 2018 · 1 comment

Comments

@ghost
Copy link

ghost commented Jan 12, 2018

New versions of kubelogin are required to work with newer infrastructure (new configs, new systems, etc). Investigate options to have kubelogin check whether it is up-to-date and download the newest version if available.

Quick google results include:
https://github.com/inconshreveable/go-update
https://github.com/rcrowley/goagain

Obligatory StackOverflow: https://stackoverflow.com/questions/27823042/is-it-possible-for-a-go-binary-to-reload-itself

@ghost
Copy link
Author

ghost commented Jan 12, 2018

Brief test examples show that Windows locks binaries while executing, meaning this needs a secondary program to update kubelogin.exe

We could include a subpackage called updater and have the resulting updater check its own version, then download a newer copy to replace the existing kubelogin binary.

  1. Run kubelogin
  2. Kubelogin detects it is out of date
  3. Kubelogin spawns updater (optional: passes all args to updater)
  4. Kubelogin exits, reporting that it is updating itself
  5. Updater downloads new kubelogin, replaces existing kubelogin executable
  6. (Optional: relaunch kubelogin with args)

I'm not sure if we want to "error out" with a message asking someone to run kubelogin again, but that could be a good first step.

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

0 participants