compat: Implement deprecations from Docker API v1.44#28787
Conversation
|
It's looks like that the mocked output with EDIT: |
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>
e6c98e5 to
e3be1af
Compare
inknos
left a comment
There was a problem hiding this comment.
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
| // 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") | ||
| } |
There was a problem hiding this comment.
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
| } | ||
|
|
There was a problem hiding this comment.
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". |
There was a problem hiding this comment.
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
|
Thank you, @inknos Regarding
[
{
"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 EDIT:
|
This PR implements API deprecations to be compatible with Docker API v1.44.
ContainerandContainerConfigfrom GET/images/{name}/jsonHairpinMode,LinkLocalIPv6Address,LinkLocalIPv6PrefixLen,SecondaryIPAddresses,SecondaryIPv6Addressesfrom GET/containers/{id}/jsonis-automated filterfor the GET/images/searchendpointDeprecations in Docker Engine API v1.44 API
Fixes: https://redhat.atlassian.net/browse/RUN-3323
Checklist
Ensure you have completed the following checklist for your pull request to be reviewed:
commits. (
git commit -s). (If needed, usegit commit -s --amend). The author email must matchthe sign-off email address. See CONTRIBUTING.md
for more information.
Fixes: #00000in commit message (if applicable)make validatepr(format/lint checks)Noneif no user-facing changes)Does this PR introduce a user-facing change?
Questions and Notes
is_automatedare according to the Docker docsnot versioned, and apply to all API versions. Hence, I'm not sure if my approach is correct.ContainerConfigfield forv1.45so I kept the version. [compat api] Remove ContainerConfig field #27172is_automatedand I kept it there.