fix deprecated docker v28 types

A lot of types are moved and now deprecated which causes lint issues.

IDResponse is copied into podman because that has no new 1 to 1
replacement. For some fields that we set as part of the docker API I
added the nolint directive as these fields might be used by API
consumers.

For the other types it is mostly a 1 to 1 move.

ParseUintList is deprecated but we can use the same function from
github.com/containers/storage/pkg/parsers instead.

Note that it containers breaking changes to pkg/bindings which we should
not do generally but given the prevoius commit already has a unavoidable
breaking change we might as well fix the IDResponse issue once now.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
This commit is contained in:
Paul Holzinger
2025-03-10 16:26:57 +01:00
parent 91a08235d1
commit f2606c4230
15 changed files with 53 additions and 152 deletions

View File

@ -11,26 +11,26 @@ import (
"github.com/containers/podman/v5/pkg/bindings"
"github.com/containers/podman/v5/pkg/bindings/images"
"github.com/containers/podman/v5/pkg/domain/entities/types"
"github.com/containers/storage/pkg/regexp"
dockerAPI "github.com/docker/docker/api/types"
)
var iidRegex = regexp.Delayed(`^[0-9a-f]{12}`)
// Commit creates a container image from a container. The container is defined by nameOrID. Use
// the CommitOptions for finer grain control on characteristics of the resulting image.
func Commit(ctx context.Context, nameOrID string, options *CommitOptions) (dockerAPI.IDResponse, error) {
func Commit(ctx context.Context, nameOrID string, options *CommitOptions) (types.IDResponse, error) {
if options == nil {
options = new(CommitOptions)
}
id := dockerAPI.IDResponse{}
id := types.IDResponse{}
conn, err := bindings.GetClient(ctx)
if err != nil {
return id, err
}
params, err := options.ToParams()
if err != nil {
return dockerAPI.IDResponse{}, err
return types.IDResponse{}, err
}
params.Set("container", nameOrID)
var requestBody io.Reader