Add --max-log-requests flag to limit concurrent requests #224
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.
Fixes #73
This PR adds the
--max-log-requests
flag to limit concurrent requests to prevent unintentional load to a cluster.The behavior and the default are different depending on the presence of the
--no-follow
flag.--no-follow
when --no-follow is specified
It limits the number of concurrent logs to request, so there is no apparent change.
I chose 5 for the default limit, the same as in kubectl.
📝 I like the combination of
--max-log-requests 1
and--no-follow
, which will show logs in order.when --no-follow is not specified
It exits with an error when if it reaches the concurrent limit.
Though I am not sure how we should choose the default limit, I think 50 is enough for most cases.