Set a request timeout on kubectl commands#360
Conversation
Member
|
Would it make sense to have this configurable, falling back to a default if not defined? |
Contributor
Author
|
I don't really think it is worth the extra complexity. The only reason to set this at all is to avoid an infinite timeout. If your API is taking However of course if you disagree and think this needs to be configurable let me know and I'll take a look at updating the PR 🙂
|
Member
|
+1 to have that configurable |
Signed-off-by: Scott Leggett <[email protected]>
Simple kubectl commands such as get, describe, and logs should return quickly, but kubectl does not set a timeout on requests by default. This can mean kubectl hangs forever if the kubernetes API stops responding during a request, which is quite possible in CI environments where jobs may cancelled and kubernetes clusters torn down while ct is running. This change sets a configurable timeout on such kubectl commands, with a default value of 30s. Signed-off-by: Scott Leggett <[email protected]>
Contributor
Author
|
Okay I added a configuration option for the kubectl timeout value. |
Signed-off-by: Scott Leggett <[email protected]>
This was referenced Sep 13, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this PR does / why we need it:
Simple kubectl commands such as get, describe, and logs should return
quickly, but kubectl does not set a timeout on requests by default.
This change sets a 30s timeout by default on such kubectl commands to
ensure that these don't hang forever if the kubernetes API stops
responding, which is quite possible in CI environments where jobs may
cancelled and kubernetes clusters torn down while ct is running.
This timeout value is configurable via the new
kubectl-timeoutoption.Which issue this PR fixes
Hopefully closes: #332
Special notes for your reviewer:
n/a