Skip to content
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

stats compat API: return "id" lowercase #17890

Merged
merged 1 commit into from
Mar 24, 2023

Conversation

Luap99
Copy link
Member

@Luap99 Luap99 commented Mar 22, 2023

We use the same endpoint for libpod and docker compat API. However as reported docker returns "id" lowercase. Because we cannot break the libpod API right now keep the output for the libpod endpoint and only change the docker one.

To do so simply use two types that we can cast with different JSON tags.

Fixes #17869

Does this PR introduce a user-facing change?

The docker compat API stats endpoint now returns the `Id` key as lowercase `id` to match docker.

@openshift-ci openshift-ci bot added release-note approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Mar 22, 2023
@github-actions github-actions bot added the kind/api-change Change to remote API; merits scrutiny label Mar 22, 2023
Copy link
Member

@vrothberg vrothberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Very elegant idea to wrap the types like that 👍

We use the same endpoint for libpod and docker compat API. However as
reported docker returns "id" lowercase. Because we cannot break the
libpod API right now keep the output for the libpod endpoint and only
change the docker one.

To do so simply use two types that we can cast with different JSON tags.

Fixes containers#17869

Signed-off-by: Paul Holzinger <[email protected]>
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Mar 22, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Luap99, zhangguanzhang

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [Luap99,zhangguanzhang]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@zhangguanzhang
Copy link
Collaborator

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Mar 24, 2023
@openshift-merge-robot openshift-merge-robot merged commit 8720235 into containers:main Mar 24, 2023
@rhatdan
Copy link
Member

rhatdan commented Mar 24, 2023

I was fooling around with this, but your solution is much better then what I came up with.
LGTM

@Luap99 Luap99 deleted the stats-compat branch March 24, 2023 12:34
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 4, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 4, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/api-change Change to remote API; merits scrutiny lgtm Indicates that a PR is ready to be merged. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. release-note
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Stats response has "Id" field instead of "id"
5 participants