-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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 one-shot
to container API stats
#3089
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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=True
is 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)
@milas, thanks for that very helpful and clear feedback. I believe this is what you'd want to see. |
e9460db
to
3c48615
Compare
@milas just pinging you again on this. It looks like everything is setup now. What do you think? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
@milas thanks again for all your helpful feedback. How are we looking on this? |
@milas just sending another ping on this. Look good? |
Add the
one-shot
parameter 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