Add one-shot to container API stats#3089
Merged
milas merged 5 commits intodocker:mainfrom Feb 16, 2023
Merged
Conversation
milas
suggested changes
Jan 26, 2023
Contributor
milas
left a comment
There was a problem hiding this comment.
Thanks for the PR!
Two adjustments:
- Since this was added in v1.41, we should check the API version if the param is set, which will realistically mean changing the default to
one_shot=None. See an example in another API call one_shot=Trueis only valid ifstream=False, so we should check that as an invariant here and raise an exception, as otherwise it'll be rather hard to debug because of the stream helper in some cases (normally I'd say rely on server-side validation, but in this case there's no sensible meaning to the combo, so it seems safe enough to add a redundant check for)
Contributor
Author
|
@milas, thanks for that very helpful and clear feedback. I believe this is what you'd want to see. |
e9460db to
3c48615
Compare
Contributor
Author
|
@milas just pinging you again on this. It looks like everything is setup now. What do you think? |
milas
suggested changes
Feb 3, 2023
Contributor
milas
left a comment
There was a problem hiding this comment.
One small tweak but LGTM otherwise. Thanks for making the changes!
Signed-off-by: Andy Roxby <107427605+aroxby-wayscript@users.noreply.github.com>
Signed-off-by: Andy Roxby <107427605+aroxby-wayscript@users.noreply.github.com>
Signed-off-by: Andy Roxby <107427605+aroxby-wayscript@users.noreply.github.com>
Co-authored-by: Milas Bowman <devnull@milas.dev> Signed-off-by: Andy Roxby <107427605+aroxby-wayscript@users.noreply.github.com>
36956e9 to
56fbf7c
Compare
Contributor
Author
|
@milas thanks again for all your helpful feedback. How are we looking on this? |
Contributor
Author
|
@milas just sending another ping on this. Look good? |
milas
approved these changes
Feb 14, 2023
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.
Add the
one-shotparameter to container stats to enable pulling just a single stats update. New in docker engine 20.10.0.See the moby PR: moby/moby#40478