-
Notifications
You must be signed in to change notification settings - Fork 18.9k
api/types/events: Message: remove deprecated Status, ID, and From fields #50832
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
Conversation
2e303e9 to
0139797
Compare
|
Failure looks related, but we need to check if it's either the test not matching correctly, or if (e.g.) the docker 18.06 CLI was using the deprecated fields; The test verifies that the CLI acts on "new container created" events, and subsequently to add the new container to the list of containers for which it's collecting stats; moby/integration-cli/docker_cli_stats_test.go Lines 137 to 176 in 50c073c
|
|
Interesting, so for some reason, with this PR, the moby/integration-cli/docker_cli_stats_test.go Lines 166 to 168 in 50c073c
The same does not happen if I start the containers before the stats command is started. I wondered if the stats command would exit if it found "no containers" during refresh, so I added some more containers before starting the stats command, but that's not it. When running the test manually (i.e. start a container, run stats, then run a second container), things look to function normally. |
|
Ah! Bug in the CLI; it's panicking; this is on docker 28.3.3 (not the old CLI) Full output below Details |
|
🙈 I just realised that the stack-dump was from the 18.06 binary, not the 28.3.2 one, so yes, it's a bug in the CLI, because the stats code doesn't check for the field to be non-empty (or expected length) before truncating; on the 28.3.2 binary, the test passes, because that uses the new fields, but the actual cause of the panic could happen on both if the field is empty or shorter than 12 chars; https://github.com/docker/cli/blob/v18.06.0-ce/cli/command/container/stats.go#L137 s := formatter.NewContainerStats(e.ID[:12])https://github.com/docker/cli/blob/v18.06.0-ce/cli/command/container/stats.go#L137 s := NewStats(e.Actor.ID[:12])It looks like the CLI switched away from depending on the deprecated fields in docker/cli@46d0ba2 Which was part of CLI v25.0.0-beta.1 (which uses API 1.44 So at least any version of the CLI older than v25.0.0, and versions of docker compose before docker/compose@7781b7c (v2.24.0) would break if we drop the fields for API < v1.44. Looks like we need to backfill those fields, but we can remove the fields, and do so when producing the response. |
Don't include the deprecated `status`, `id`, and `from` fields in event responses. These fields were deprecated in [moby@72f188] (docker v1.10, API v1.22), but the daemon still included them in the response. Unfortunately, the Docker CLI (and compose indirectly), continued using these fields up until v25.0.0, and panic if the fields are omitted, or left empty (due to a bug), see: moby#50832 (comment) so we need to continue producing these fields on API < v1.52. [moby@72f188]: moby@72f1881 Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
0139797 to
abdcc07
Compare
|
I THINK I've seen this one fail a few times; could be flaky, although it failed in 2 separate checks in this PR, so need to check if it could be legit (or require some test to be adjusted); |
These fields were deprecated in [moby@72f188] (docker v1.10, API v1.22), and we shouldn't test for them. [moby@72f188]: moby@72f1881 Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Don't include the deprecated `status`, `id`, and `from` fields in event responses. These fields were deprecated in [moby@72f188] (docker v1.10, API v1.22), but the daemon still included them in the response. Unfortunately, the Docker CLI (and compose indirectly), continued using these fields up until v25.0.0, and panic if the fields are omitted, or left empty (due to a bug), see: moby#50832 (comment) so we need to continue producing these fields on API < v1.52. [moby@72f188]: moby@72f1881 Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
These fields were deprecated in [moby@72f188] (docker v1.10, API v1.22), with the deprecation message updated to be in the correct format in [moby@247f47] (docker v23.0). [moby@72f188]: moby@72f1881 [moby@247f47]: moby@247f479 Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
abdcc07 to
1b74b3e
Compare
|
The "id" field in Docker events is deprecated since a while and got removed with moby/moby#50832. Use the "actor.id" field instead to avoid issues with newer Docker versions. This field got added with Docker 1.10.0, so much older version then we actually support.
GET /events no longer includes the deprecated status, id, and from fields. These fields were removed in API v1.22, but still included in the response. These fields are now omitted when using API v1.52 or later. See moby/moby#50832
GET /events no longer includes the deprecated status, id, and from fields. These fields were removed in API v1.22, but still included in the response. These fields are now omitted when using API v1.52 or later. See moby/moby#50832
depends on / stacked on:
relates to:
api/docs: fix events example response
Don't include the deprecated
id,status, andfromfieldsin the response; they're no longer part of the API since v1.22
(moby@72f188).
daemon/events: remove tests for deprecated API fields
These fields were deprecated in moby@72f188 (docker v1.10, API v1.22),
and we shouldn't test for them.
daemon/events: don't include deprecated
status,id, andfromfieldsThese fields were deprecated in moby@72f188 (docker v1.10, API v1.22),
but the daemon still included them in the response.
api/types/events: Message: remove deprecated Status, ID, and From fields
These fields were deprecated in moby@72f188 (docker v1.10, API v1.22),
with the deprecation message updated to be in the correct format in
moby@247f47 (docker v23.0).
- Human readable description for the release notes
- A picture of a cute animal (not mandatory but encouraged)