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

Add a --timeout flag to allow retrying operations for a longer time #830

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

kke
Copy link
Contributor

@kke kke commented Feb 3, 2025

Adds a --timeout=<duration> flag for most subcommands.

Usage:

k0sctl apply --timeout=120m

The timeout is not absolutely effective for all operations as the current version of rig does not support command timeouts (v2 does but migration #755 is still unfinished) and if a remote command hangs forever or past the timeout, it won't bite and abort the command, but instead keep waiting for it to finish.

If a timeout is not given, the pre-existing per step predefined (seems to always be either 30 seconds or 2 minutes) timeouts are be used and the functionality should remain the same.

If a timeout is given, each of those operations will be retried until the global timeout expires.

I'm not completely sure about naming it --timeout as it usually would imply that a long-running operation would be cut short when the time is exceeded, but in this case the use-case should more often seem to be to make it run longer than usual.

While making this I realized there was already the --retry-timeout ("Default timeout when waiting for node state changes") flag that could have been used for some operations. It should probably be deprecated with the addition of --timeout.

@kke kke added the enhancement New feature or request label Feb 3, 2025
@kke kke marked this pull request as draft February 3, 2025 13:12
@kke kke marked this pull request as ready for review February 3, 2025 14:43
@kke kke requested review from twz123 and jnummelin February 3, 2025 14:43
@kke kke changed the title Add a global --timeout Add a --timeout flag to allow retrying operations for a longer time Feb 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant