Skip to content

compat: Implement deprecations from Docker API v1.44#28787

Open
simek-m wants to merge 4 commits into
containers:mainfrom
simek-m:docker-api-144-deprecations
Open

compat: Implement deprecations from Docker API v1.44#28787
simek-m wants to merge 4 commits into
containers:mainfrom
simek-m:docker-api-144-deprecations

Conversation

@simek-m
Copy link
Copy Markdown

@simek-m simek-m commented May 26, 2026

This PR implements API deprecations to be compatible with Docker API v1.44.

  • api: Deprecate fields Container and ContainerConfig from GET /images/{name}/json
  • api: Deprecate response fields HairpinMode, LinkLocalIPv6Address,
    LinkLocalIPv6PrefixLen, SecondaryIPAddresses, SecondaryIPv6Addresses from GET /containers/{id}/json
  • api: Deprecate is-automated filter for the GET /images/search endpoint

Deprecations in Docker Engine API v1.44 API

Deprecated: The is_automated field in the GET /images/search response has been deprecated and will always be set to false in the future because Docker Hub is deprecating the is_automated field in its search API. The deprecation is not versioned, and applies to all API versions.
Deprecated: The is-automated filter for the GET /images/search endpoint. The is_automated field has been deprecated by Docker Hub's search API. Consequently, searching for is-automated=true will yield no results. The deprecation is not versioned, and applies to all API versions.

The fields HairpinMode, LinkLocalIPv6Address, LinkLocalIPv6PrefixLen, SecondaryIPAddresses, SecondaryIPv6Addresses available in NetworkSettings when calling GET /containers/{id}/json are deprecated and will be removed in a future release. You should instead look for the default network in NetworkSettings.Networks.

The Container and ContainerConfig fields in the GET /images/{name}/json response are deprecated and will no longer be included in API v1.45.

Fixes: https://redhat.atlassian.net/browse/RUN-3323

Checklist

Ensure you have completed the following checklist for your pull request to be reviewed:

  • Certify you wrote the patch or otherwise have the right to pass it on as an open-source patch by signing all
    commits. (git commit -s). (If needed, use git commit -s --amend). The author email must match
    the sign-off email address. See CONTRIBUTING.md
    for more information.
  • Referenced issues using Fixes: #00000 in commit message (if applicable)
  • Tests have been added/updated (or no tests are needed)
  • Documentation has been updated (or no documentation changes are needed)
  • All commits pass make validatepr (format/lint checks)
  • Release note entered in the section below (or None if no user-facing changes)

Does this PR introduce a user-facing change?

- api: is_automated field in the GET /images/search response has been deprecated 
- api: is-automated filter for the GET /images/search endpoint has been deprecated and will be ignored
- api: fields HairpinMode, LinkLocalIPv6Address, LinkLocalIPv6PrefixLen, SecondaryIPAddresses, SecondaryIPv6Addresses available in NetworkSettings when calling GET /containers/{id}/json are deprecated.
- api: Container and ContainerConfig fields in the GET /images/{name}/json response are deprecated

Questions and Notes

  • The changes to is_automated are according to the Docker docs not versioned, and apply to all API versions. Hence, I'm not sure if my approach is correct.
  • Should there be any warning log? I couldn't find any example of that in the existing code.
  • The PR version gated the ContainerConfig field for v1.45 so I kept the version. [compat api] Remove ContainerConfig field #27172
  • The test mocked output in search_mock_registry.go includes is_automated and I kept it there.

@simek-m
Copy link
Copy Markdown
Author

simek-m commented May 26, 2026

It's looks like that the mocked output with is_automated mentioned above is an issue (or the version gate not differentiating between libpod and compat?). I'll fix it.

[+1031s] Summarizing 1 Failure:
[+1031s]   [FAIL] Podman search podman search with mock registry [It] podman search with filter is-automated
[+1031s]   /var/tmp/go/src/github.com/containers/podman/test/e2e/search_test.go:185

EDIT:
Fixed in e6c98e5 and the additional failures appear not to be related to changes in this branch.

simek-m added 4 commits May 26, 2026 17:17
The Docker API in version 1.44 deprecates the is_automated field for
the GET /images/search endpoint. The is_automated field has been deprecated
by Docker Hub's search API. Consequently, searching for is-automated=true
will yield no results.

The Docker API in version 1.44 deprecates the is_automated field
in the GET /images/search response and will always be set to false in the
future because Docker Hub is deprecating the is_automated field in its search API.

Fixes: https://redhat.atlassian.net/browse/RUN-3323

Signed-off-by: Marek Simek <msimek@redhat.com>
The Docker API 1.44 deprecates the fields HairpinMode, LinkLocalIPv6Address,
LinkLocalIPv6PrefixLen, SecondaryIPAddresses, SecondaryIPv6Addresses available in
NetworkSettings when calling GET /containers/{id}/json and will be removed in a future release.
You should instead look for the default network in NetworkSettings.Networks.

Fixes: https://redhat.atlassian.net/browse/RUN-3323

Signed-off-by: Marek Simek <msimek@redhat.com>
…{name}/json

The Docker API deprecates Container and ContainerConfig fields in
the GET /images/{name}/json response are deprecated and
they will no longer be included in API v1.45.

Fixes: https://redhat.atlassian.net/browse/RUN-3323

Signed-off-by: Marek Simek <msimek@redhat.com>
…endpoint

Signed-off-by: Marek Simek <msimek@redhat.com>
@simek-m simek-m force-pushed the docker-api-144-deprecations branch from e6c98e5 to e3be1af Compare May 26, 2026 15:19
@github-actions github-actions Bot added the kind/api-change Change to remote API; merits scrutiny label May 26, 2026
Copy link
Copy Markdown
Collaborator

@inknos inknos left a comment

Choose a reason for hiding this comment

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

Most likely you also want some versioned tests against the compat endpoints like in this previous PR about deprecating endpoints. https://github.com/containers/podman/pull/26213/changes

also, minor thing, the fixup commit could be squashed imho

Comment on lines +54 to +57
// https://docs.docker.com/reference/api/engine/version-history/#v144-api-changes
if _, err := apiutil.SupportedVersion(r, ">=1.44.0"); err == nil && !utils.IsLibpodRequest(r) {
delete(query.Filters, "is-automated")
}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

stated in docker's api

The deprecation is not versioned, and applies to all API versions.

therefore I believe it should just be deleted, not only if version >= 1.44

Comment on lines 87 to 88
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

probably the Automated field should be zeroed out before writing to the response since it's documented to be always false. also, I would verify what docker wants, probably a bool and not a string. Then I would add a specific test for this field and its type

Stars int
// Official indicates if it's an official image.
Official string
// Deprecated: the "is_automated" field is deprecated and will always be "false".
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

we are not really deprecating this, but we want to touch the compat struct only, which we don't have. Therefore, I believe it's better to create a compat struct with the correct docker types and the deprecation should happen there. this struc is used elsewhere and we don't deprecate this option for the libpod code

@simek-m
Copy link
Copy Markdown
Author

simek-m commented May 27, 2026

Thank you, @inknos

Regarding is_automated / is-automated:

  • How I approached the deprecation is definitely wrong, but I'm now not sure if there should be any other action on the filter side apart from documenting it. My reasoning is that they state searching for is-automated=true will yield no results and it should be transparent to the consumer, i.e. searching for is-automated=true will yield no results.
  • Likewise, I'm not sure the is_automated field should be zeroed or be transparent and pass it as it's received (maybe omitempty?). It looks like it's a Docker Hub only thing, though.
  • The compat response struct with a deprecation is a very good point, for the record the current response looks like this:
[
  {
    "Index": "docker.io",
    "Name": "docker.io/library/alpine",
    "Description": "A minimal Docker image based on Alpine Linux with a complete package index and only 5 MB in size!",
    "Stars": 11509,
    "Official": "[OK]",
    "Automated": "",
    "Tag": ""
  },
  {
    "Index": "docker.io",
    "Name": "docker.io/alpine/git",
    "Description": "A  simple git container running in alpine linux, especially for tiny linux distro.",
    "Stars": 252,
    "Official": "",
    "Automated": "[OK]",
    "Tag": ""
  },
  {
    "Index": "docker.io",
    "Name": "docker.io/alpine/socat",
    "Description": "Run socat command in alpine container",
    "Stars": 115,
    "Official": "",
    "Automated": "[OK]",
    "Tag": ""
  },
  {
    "Index": "docker.io",
    "Name": "docker.io/alpine/curl",
    "Description": "",
    "Stars": 12,
    "Official": "",
    "Automated": "",
    "Tag": ""
  },
  {
    "Index": "docker.io",
    "Name": "docker.io/alpine/helm",
    "Description": "Auto-trigger docker build for kubernetes helm when new release is announced",
    "Stars": 70,
    "Official": "",
    "Automated": "",
    "Tag": ""
  }
]

and the Docker one like this:

[
  {
    "star_count": 11509,
    "is_official": true,
    "name": "alpine",
    "is_automated": false,
    "description": "A minimal Docker image based on Alpine Linux with a complete package index and only 5 MB in size!"
  },
  {
    "star_count": 252,
    "is_official": false,
    "name": "alpine/git",
    "is_automated": false,
    "description": "A  simple git container running in alpine linux, especially for tiny linux distro."
  },
  {
    "star_count": 115,
    "is_official": false,
    "name": "alpine/socat",
    "is_automated": false,
    "description": "Run socat command in alpine container"
  },
  {
    "star_count": 12,
    "is_official": false,
    "name": "alpine/curl",
    "is_automated": false,
    "description": ""
  },
  {
    "star_count": 70,
    "is_official": false,
    "name": "alpine/helm",
    "is_automated": false,
    "description": "Auto-trigger docker build for kubernetes helm when new release is announced"
  }
]

What do you think?

(The fixup commits were not autosquashed, because I'd already opened the PR and wanted to make clear what was changed after and avoid force-pushing.)

EDIT:
Discussed elsewhere and the plan is:

  • Introduce compat structure matching the Docker one (can be directly imported).
  • Document in Swagger.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/api-change Change to remote API; merits scrutiny

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants