Skip to content

Commit

Permalink
Merge pull request #21322 from containers/renovate/github.com-docker-…
Browse files Browse the repository at this point in the history
…docker-25.x

Update module github.com/docker/docker to v25
  • Loading branch information
openshift-merge-bot[bot] authored Jan 24, 2024
2 parents 73a100e + 3e6bfb6 commit 01b2243
Show file tree
Hide file tree
Showing 214 changed files with 12,455 additions and 2,221 deletions.
5 changes: 4 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ require (
github.com/cyphar/filepath-securejoin v0.2.4
github.com/digitalocean/go-qemu v0.0.0-20230711162256-2e3d0186973e
github.com/docker/distribution v2.8.3+incompatible
github.com/docker/docker v24.0.7+incompatible
github.com/docker/docker v25.0.0+incompatible
github.com/docker/go-connections v0.5.0
github.com/docker/go-plugins-helpers v0.0.0-20211224144127-6eecb7beb651
github.com/docker/go-units v0.5.0
Expand Down Expand Up @@ -164,6 +164,7 @@ require (
github.com/moby/patternmatcher v0.6.0 // indirect
github.com/moby/sys/mountinfo v0.7.1 // indirect
github.com/moby/sys/sequential v0.5.0 // indirect
github.com/moby/sys/user v0.1.0 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/morikuni/aec v1.0.0 // indirect
Expand Down Expand Up @@ -200,13 +201,15 @@ require (
go.mongodb.org/mongo-driver v1.13.1 // indirect
go.mozilla.org/pkcs7 v0.0.0-20210826202110-33d05740a352 // indirect
go.opencensus.io v0.24.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.45.0 // indirect
go.opentelemetry.io/otel v1.19.0 // indirect
go.opentelemetry.io/otel/metric v1.19.0 // indirect
go.opentelemetry.io/otel/trace v1.19.0 // indirect
golang.org/x/arch v0.5.0 // indirect
golang.org/x/crypto v0.18.0 // indirect
golang.org/x/mod v0.14.0 // indirect
golang.org/x/oauth2 v0.15.0 // indirect
golang.org/x/time v0.3.0 // indirect
golang.org/x/tools v0.16.1 // indirect
google.golang.org/appengine v1.6.8 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20230920204549-e6e6cdab5c13 // indirect
Expand Down
17 changes: 15 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ github.com/bytedance/sonic v1.10.0-rc/go.mod h1:ElCzW+ufi8qKqNW0FY314xriJhyJhuoJ
github.com/bytedance/sonic v1.10.1 h1:7a1wuFXL1cMy7a3f7/VFcEtriuXQnUBhtoVfOZiaysc=
github.com/bytedance/sonic v1.10.1/go.mod h1:iZcSUejdk5aukTND/Eu/ivjQuEL0Cu9/rf50Hi0u/g4=
github.com/cenkalti/backoff/v4 v4.1.1/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw=
github.com/cenkalti/backoff/v4 v4.2.1 h1:y4OZtCnogmCPw98Zjyt5a6+QwPLGkiQsYW5oUqylYbM=
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko=
github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc=
Expand Down Expand Up @@ -346,8 +347,8 @@ github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4Kfc
github.com/docker/distribution v2.8.3+incompatible h1:AtKxIZ36LoNK51+Z6RpzLpddBirtxJnzDrHLEKxTAYk=
github.com/docker/distribution v2.8.3+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
github.com/docker/docker v1.4.2-0.20190924003213-a8608b5b67c7/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
github.com/docker/docker v24.0.7+incompatible h1:Wo6l37AuwP3JaMnZa226lzVXGA3F9Ig1seQen0cKYlM=
github.com/docker/docker v24.0.7+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
github.com/docker/docker v25.0.0+incompatible h1:g9b6wZTblhMgzOT2tspESstfw6ySZ9kdm94BLDKaZac=
github.com/docker/docker v25.0.0+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
github.com/docker/docker-credential-helpers v0.6.3/go.mod h1:WRaJzqw3CTB9bk10avuGsjVBZsD05qeibJ1/TYlvc0Y=
github.com/docker/docker-credential-helpers v0.8.0 h1:YQFtbBQb4VrpoPxhFuzEBPQ9E16qz5SpHLS+uswaCp8=
github.com/docker/docker-credential-helpers v0.8.0/go.mod h1:UGFXcuoQ5TxPiB54nHOZ32AWRqQdECoh/Mg0AlEYb40=
Expand Down Expand Up @@ -631,7 +632,9 @@ github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk=
github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY=
github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY=
github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo=
github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw=
github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.0 h1:RtRsiaGvWxcwd8y3BiRZxsylPT8hLWZ5SPcfI+3IDNk=
github.com/hashicorp/errwrap v0.0.0-20141028054710-7554cd9344ce/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I=
Expand Down Expand Up @@ -796,6 +799,8 @@ github.com/moby/sys/mountinfo v0.7.1/go.mod h1:IJb6JQeOklcdMU9F5xQ8ZALD+CUr5VlGp
github.com/moby/sys/sequential v0.5.0 h1:OPvI35Lzn9K04PBbCLW0g4LcFAJgHsvXsRyewg5lXtc=
github.com/moby/sys/sequential v0.5.0/go.mod h1:tH2cOOs5V9MlPiXcQzRC+eEyab644PWKGRYaaV5ZZlo=
github.com/moby/sys/symlink v0.1.0/go.mod h1:GGDODQmbFOjFsXvfLVn3+ZRxkch54RkSiGqsZeMYowQ=
github.com/moby/sys/user v0.1.0 h1:WmZ93f5Ux6het5iituh9x2zAG7NFY9Aqi49jjE1PaQg=
github.com/moby/sys/user v0.1.0/go.mod h1:fKJhFOnsCN6xZ5gSfbM6zaHGgDJMrqt9/reuj4T7MmU=
github.com/moby/term v0.0.0-20200312100748-672ec06f55cd/go.mod h1:DdlQx2hp0Ss5/fLikoLlEeIYiATotOjgB//nb973jeo=
github.com/moby/term v0.5.0 h1:xt8Q1nalod/v7BqbG21f8mQPqH+xAaC9C3N3wfWbVP0=
github.com/moby/term v0.5.0/go.mod h1:8FzsFHVUBGZdbDsJw/ot+X+d5HLUbvklYLJ9uGfcI3Y=
Expand Down Expand Up @@ -1140,14 +1145,19 @@ go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0=
go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo=
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.45.0 h1:x8Z78aZx8cOF0+Kkazoc7lwUNMGy0LrzEMxTm4BbTxg=
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.45.0/go.mod h1:62CPTSry9QZtOaSsE3tOzhx6LzDhHnXJ6xHeMNNiM6Q=
go.opentelemetry.io/otel v1.19.0 h1:MuS/TNf4/j4IXsZuJegVzI1cwut7Qc00344rgH7p8bs=
go.opentelemetry.io/otel v1.19.0/go.mod h1:i0QyjOq3UPoTzff0PJB2N66fb4S0+rSbSB15/oyH9fY=
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.19.0 h1:Mne5On7VWdx7omSrSSZvM4Kw7cS7NQkOOmLcgscI51U=
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.19.0 h1:IeMeyr1aBvBiPVYihXIaeIZba6b8E1bYp7lbdxK8CQg=
go.opentelemetry.io/otel/metric v1.19.0 h1:aTzpGtV0ar9wlV4Sna9sdJyII5jTVJEvKETPiOKwvpE=
go.opentelemetry.io/otel/metric v1.19.0/go.mod h1:L5rUsV9kM1IxCj1MmSdS+JQAcVm319EUrDVLrt7jqt8=
go.opentelemetry.io/otel/sdk v1.19.0 h1:6USY6zH+L8uMH8L3t1enZPR3WFEmSTADlqldyHtJi3o=
go.opentelemetry.io/otel/trace v1.19.0 h1:DFVQmlVbfVeOuBRrwdtaehRrWiL1JoVs9CPIQ1Dzxpg=
go.opentelemetry.io/otel/trace v1.19.0/go.mod h1:mfaSyvGyEJEI0nyV2I4qhNQnbBOUUmYZpYojqMnX2vo=
go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI=
go.opentelemetry.io/proto/otlp v1.0.0 h1:T0TX0tmXU8a3CbNXzEKGeU5mIVOdf0oykP+u2lIVU/I=
go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
go.uber.org/goleak v1.2.1 h1:NBol2c7O1ZokfZ0LEU9K6Whx/KnwvepVetCUhtKja4A=
Expand Down Expand Up @@ -1415,6 +1425,7 @@ golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxb
golang.org/x/time v0.0.0-20200416051211-89c76fbcd5d1/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4=
golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20181011042414-1f849cf54d09/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
Expand Down Expand Up @@ -1519,6 +1530,8 @@ google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfG
google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo=
google.golang.org/genproto v0.0.0-20200527145253-8367513e4ece/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA=
google.golang.org/genproto v0.0.0-20201110150050-8816d57aaa9a/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/genproto v0.0.0-20230913181813-007df8e322eb h1:XFBgcDwm7irdHTbz4Zk2h7Mh+eis4nfJEFQFYzJzuIA=
google.golang.org/genproto/googleapis/api v0.0.0-20230913181813-007df8e322eb h1:lK0oleSc7IQsUxO3U5TjL9DWlsxpEBemh+zpB7IqhWI=
google.golang.org/genproto/googleapis/rpc v0.0.0-20230920204549-e6e6cdab5c13 h1:N3bU/SQDCDyD6R528GJ/PwW9KjYcJA3dgyH+MovAkIM=
google.golang.org/genproto/googleapis/rpc v0.0.0-20230920204549-e6e6cdab5c13/go.mod h1:KSqppvjFjtoCI+KGd4PELB0qLNxdJHRGqRI09mB6pQA=
google.golang.org/grpc v0.0.0-20160317175043-d3ddb4469d5a/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw=
Expand Down
3 changes: 2 additions & 1 deletion pkg/api/handlers/compat/containers.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
"github.com/containers/podman/v4/pkg/signal"
"github.com/containers/podman/v4/pkg/util"
"github.com/docker/docker/api/types"
dockerBackend "github.com/docker/docker/api/types/backend"
"github.com/docker/docker/api/types/container"
"github.com/docker/docker/api/types/network"
"github.com/docker/go-connections/nat"
Expand Down Expand Up @@ -397,7 +398,7 @@ func LibpodToContainer(l *libpod.Container, sz bool) (*handlers.Container, error
NetworkSettings: &networkSettings,
Mounts: mounts,
},
ContainerCreateConfig: types.ContainerCreateConfig{},
ContainerCreateConfig: dockerBackend.ContainerCreateConfig{},
}, nil
}

Expand Down
11 changes: 8 additions & 3 deletions pkg/api/handlers/compat/containers_create.go
Original file line number Diff line number Diff line change
Expand Up @@ -307,8 +307,13 @@ func cliOpts(cc handlers.CreateContainerConfig, rtc *config.Config) (*entities.C
NoHosts: rtc.Containers.NoHosts,
}

// sigh docker-compose sets the mac address on the container config instead on the per network endpoint config
containerMacAddress := cc.MacAddress
// docker-compose sets the mac address on the container config instead
// on the per network endpoint config
//
// This field is deprecated since API v1.44 where
// EndpointSettings.MacAddress is used instead (and has precedence
// below). Let's still use it for backwards compat.
containerMacAddress := cc.MacAddress //nolint:staticcheck

// network names
switch {
Expand Down Expand Up @@ -555,7 +560,7 @@ func cliOpts(cc handlers.CreateContainerConfig, rtc *config.Config) (*entities.C
}

if len(cc.HostConfig.RestartPolicy.Name) > 0 {
policy := cc.HostConfig.RestartPolicy.Name
policy := string(cc.HostConfig.RestartPolicy.Name)
// only add restart count on failure
if cc.HostConfig.RestartPolicy.IsOnFailure() {
policy += fmt.Sprintf(":%d", cc.HostConfig.RestartPolicy.MaximumRetryCount)
Expand Down
3 changes: 2 additions & 1 deletion pkg/api/handlers/compat/images.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (
"github.com/containers/storage"
docker "github.com/docker/docker/api/types"
dockerContainer "github.com/docker/docker/api/types/container"
dockerImage "github.com/docker/docker/api/types/image"
"github.com/docker/go-connections/nat"
"github.com/opencontainers/go-digest"
"github.com/sirupsen/logrus"
Expand Down Expand Up @@ -381,7 +382,7 @@ func imageDataToImageInspect(ctx context.Context, l *libimage.Image) (*handlers.
DockerVersion: info.Version,
GraphDriver: graphDriver,
ID: "sha256:" + l.ID(),
Metadata: docker.ImageMetadata{},
Metadata: dockerImage.Metadata{},
Os: info.Os,
OsVersion: info.Version,
Parent: info.Parent,
Expand Down
5 changes: 3 additions & 2 deletions pkg/api/handlers/compat/images_prune.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
"github.com/containers/podman/v4/pkg/domain/infra/abi"
"github.com/containers/podman/v4/pkg/util"
"github.com/docker/docker/api/types"
dockerImage "github.com/docker/docker/api/types/image"
)

func PruneImages(w http.ResponseWriter, r *http.Request) {
Expand Down Expand Up @@ -41,7 +42,7 @@ func PruneImages(w http.ResponseWriter, r *http.Request) {
return
}

idr := make([]types.ImageDeleteResponseItem, 0, len(imagePruneReports))
idr := make([]dockerImage.DeleteResponse, 0, len(imagePruneReports))
var reclaimedSpace uint64
var errorMsg bytes.Buffer
for _, p := range imagePruneReports {
Expand All @@ -53,7 +54,7 @@ func PruneImages(w http.ResponseWriter, r *http.Request) {
continue
}

idr = append(idr, types.ImageDeleteResponseItem{
idr = append(idr, dockerImage.DeleteResponse{
Deleted: p.Id,
})
reclaimedSpace += p.Size
Expand Down
23 changes: 11 additions & 12 deletions pkg/api/handlers/compat/info.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ import (
"github.com/containers/podman/v4/pkg/api/handlers/utils"
api "github.com/containers/podman/v4/pkg/api/types"
"github.com/containers/podman/v4/pkg/rootless"
docker "github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/registry"
"github.com/docker/docker/api/types/swarm"
dockerSystem "github.com/docker/docker/api/types/system"
"github.com/google/uuid"
"github.com/opencontainers/selinux/go-selinux"
log "github.com/sirupsen/logrus"
Expand Down Expand Up @@ -53,7 +53,7 @@ func GetInfo(w http.ResponseWriter, r *http.Request) {
// liveRestoreEnabled := criu.CheckForCriu() && configInfo.RuntimeSupportsCheckpoint()

info := &handlers.Info{
Info: docker.Info{
Info: dockerSystem.Info{
Architecture: goRuntime.GOARCH,
BridgeNfIP6tables: !sysInfo.BridgeNFCallIP6TablesDisabled,
BridgeNfIptables: !sysInfo.BridgeNFCallIPTablesDisabled,
Expand All @@ -62,7 +62,7 @@ func GetInfo(w http.ResponseWriter, r *http.Request) {
CPUSet: sysInfo.Cpuset,
CPUShares: sysInfo.CPUShares,
CgroupDriver: configInfo.Engine.CgroupManager,
ContainerdCommit: docker.Commit{},
ContainerdCommit: dockerSystem.Commit{},
Containers: infoData.Store.ContainerStore.Number,
ContainersPaused: stateInfo[define.ContainerStatePaused],
ContainersRunning: stateInfo[define.ContainerStateRunning],
Expand All @@ -81,7 +81,7 @@ func GetInfo(w http.ResponseWriter, r *http.Request) {
Images: infoData.Store.ImageStore.Number,
IndexServerAddress: "",
InitBinary: "",
InitCommit: docker.Commit{},
InitCommit: dockerSystem.Commit{},
Isolation: "",
KernelMemoryTCP: false,
KernelVersion: infoData.Host.Kernel,
Expand All @@ -101,14 +101,14 @@ func GetInfo(w http.ResponseWriter, r *http.Request) {
OomKillDisable: sysInfo.OomKillDisable,
OperatingSystem: infoData.Host.Distribution.Distribution,
PidsLimit: sysInfo.PidsLimit,
Plugins: docker.PluginsInfo{
Plugins: dockerSystem.PluginsInfo{
Volume: infoData.Plugins.Volume,
Network: infoData.Plugins.Network,
Log: infoData.Plugins.Log,
},
ProductLicense: "Apache-2.0",
RegistryConfig: getServiceConfig(runtime),
RuncCommit: docker.Commit{},
RuncCommit: dockerSystem.Commit{},
Runtimes: getRuntimes(configInfo),
SecurityOptions: getSecOpts(sysInfo),
ServerVersion: versionInfo.Version,
Expand Down Expand Up @@ -190,13 +190,12 @@ func getSecOpts(sysInfo *sysinfo.SysInfo) []string {
return secOpts
}

func getRuntimes(configInfo *config.Config) map[string]docker.Runtime {
runtimes := map[string]docker.Runtime{}
func getRuntimes(configInfo *config.Config) map[string]dockerSystem.RuntimeWithStatus {
runtimes := map[string]dockerSystem.RuntimeWithStatus{}
for name, paths := range configInfo.Engine.OCIRuntimes {
runtimes[name] = docker.Runtime{
Path: paths[0],
Args: nil,
}
runtime := dockerSystem.RuntimeWithStatus{}
runtime.Runtime = dockerSystem.Runtime{Path: paths[0], Args: nil}
runtimes[name] = runtime
}
return runtimes
}
Expand Down
5 changes: 4 additions & 1 deletion pkg/api/handlers/compat/networks.go
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,10 @@ func CreateNetwork(w http.ResponseWriter, r *http.Request) {
}

opts := nettypes.NetworkCreateOptions{
IgnoreIfExists: !networkCreate.CheckDuplicate,
// networkCreate.CheckDuplicate is deprecated since API v1.44,
// but it defaults to true when sent by the client package to
// older daemons.
IgnoreIfExists: false,
}
ic := abi.ContainerEngine{Libpod: runtime}
newNetwork, err := ic.NetworkCreate(r.Context(), network, &opts)
Expand Down
5 changes: 3 additions & 2 deletions pkg/api/handlers/compat/system.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"github.com/containers/podman/v4/pkg/domain/entities"
"github.com/containers/podman/v4/pkg/domain/infra/abi"
docker "github.com/docker/docker/api/types"
dockerImage "github.com/docker/docker/api/types/image"
"github.com/docker/docker/api/types/volume"
)

Expand All @@ -24,9 +25,9 @@ func GetDiskUsage(w http.ResponseWriter, r *http.Request) {
return
}

imgs := make([]*docker.ImageSummary, len(df.Images))
imgs := make([]*dockerImage.Summary, len(df.Images))
for i, o := range df.Images {
t := docker.ImageSummary{
t := dockerImage.Summary{
Containers: int64(o.Containers),
Created: o.Created.Unix(),
ID: o.ImageID,
Expand Down
3 changes: 2 additions & 1 deletion pkg/api/handlers/swagger/responses.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"github.com/containers/podman/v4/pkg/domain/entities/reports"
"github.com/containers/podman/v4/pkg/inspect"
dockerAPI "github.com/docker/docker/api/types"
dockerImage "github.com/docker/docker/api/types/image"
dockerVolume "github.com/docker/docker/api/types/volume"
)

Expand Down Expand Up @@ -219,7 +220,7 @@ type execSessionInspect struct {
// swagger:response
type imageList struct {
// in:body
Body []dockerAPI.ImageSummary
Body []dockerImage.Summary
}

// Image summary for libpod API
Expand Down
6 changes: 4 additions & 2 deletions pkg/api/handlers/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@ package handlers
import (
"github.com/containers/podman/v4/pkg/domain/entities"
docker "github.com/docker/docker/api/types"
dockerBackend "github.com/docker/docker/api/types/backend"
dockerContainer "github.com/docker/docker/api/types/container"
dockerNetwork "github.com/docker/docker/api/types/network"
"github.com/docker/docker/api/types/registry"
"github.com/opencontainers/runtime-spec/specs-go"
)

type AuthConfig struct {
docker.AuthConfig
registry.AuthConfig
}

type ImageInspect struct {
Expand Down Expand Up @@ -79,7 +81,7 @@ type Info struct {

type Container struct {
docker.Container
docker.ContainerCreateConfig
dockerBackend.ContainerCreateConfig
}

type DiskUsage struct {
Expand Down
8 changes: 4 additions & 4 deletions pkg/domain/entities/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ func ConvertToLibpodEvent(e Event) *libpodEvents.Event {
return nil
}
}
status, err := libpodEvents.StringToStatus(e.Action)
status, err := libpodEvents.StringToStatus(string(e.Action))
if err != nil {
return nil
}
t, err := libpodEvents.StringToType(e.Type)
t, err := libpodEvents.StringToType(string(e.Type))
if err != nil {
return nil
}
Expand Down Expand Up @@ -75,8 +75,8 @@ func ConvertToEntitiesEvent(e libpodEvents.Event) *Event {
Status: e.Status.String(),
ID: e.ID,
From: e.Image,
Type: e.Type.String(),
Action: e.Status.String(),
Type: dockerEvents.Type(e.Type.String()),
Action: dockerEvents.Action(e.Status.String()),
Actor: dockerEvents.Actor{
ID: e.ID,
Attributes: attributes,
Expand Down
7 changes: 4 additions & 3 deletions test/apiv2/35-networks.at
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,10 @@ t GET networks/podman 200 \

# network create docker
t POST networks/create Name=net3\ IPAM='{"Config":[]}' 201
# create with same name should not error unless CheckDuplicate is set
t POST networks/create Name=net3 201
t POST networks/create Name=net3\ CheckDuplicate=true 409
# Since Docker API 1.44, the server always checks for duplicate networks, even
# when the deprecated CheckDuplicate parameter is set
t POST networks/create Name=net3 409
t POST networks/create Name=net3\ CheckDuplicate=false 409
# network delete docker
t DELETE networks/net3 204

Expand Down
Loading

0 comments on commit 01b2243

Please sign in to comment.