File: 0001-Revert-vendor-update-github.com-docker-docker-to-v28.patch

package info (click to toggle)
podman 5.7.0%2Bds2-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 23,824 kB
  • sloc: sh: 4,700; python: 2,798; perl: 1,885; ansic: 1,484; makefile: 977; ruby: 42; csh: 8
file content (129 lines) | stat: -rw-r--r-- 4,936 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
From: Reinhard Tartler <siretart@tauware.de>
Date: Mon, 20 Oct 2025 05:52:28 -0400
Subject: Revert "vendor: update github.com/docker/docker to v28.2.2"

This reverts commit d44f0afa84a620127a9a4ece2eb8a7bd20b7a9fc.
---
 pkg/api/handlers/compat/images.go | 56 +++++++++++++++++++++++++++++----------
 pkg/api/handlers/compat/info.go   |  2 ++
 pkg/api/handlers/compat/system.go |  4 +--
 3 files changed, 46 insertions(+), 16 deletions(-)

diff --git a/pkg/api/handlers/compat/images.go b/pkg/api/handlers/compat/images.go
index b800714..e92df5a 100644
--- a/pkg/api/handlers/compat/images.go
+++ b/pkg/api/handlers/compat/images.go
@@ -24,9 +24,8 @@ import (
 	dockerContainer "github.com/docker/docker/api/types/container"
 	dockerImage "github.com/docker/docker/api/types/image"
 	dockerStorage "github.com/docker/docker/api/types/storage"
-	dockerSpec "github.com/moby/docker-image-spec/specs-go/v1"
+	"github.com/docker/go-connections/nat"
 	"github.com/opencontainers/go-digest"
-	imageSpec "github.com/opencontainers/image-spec/specs-go/v1"
 	"github.com/sirupsen/logrus"
 	"go.podman.io/common/libimage"
 	"go.podman.io/common/pkg/config"
@@ -355,20 +354,22 @@ func imageDataToImageInspect(ctx context.Context, l *libimage.Image, r *http.Req
 	if err != nil {
 		return nil, err
 	}
+	ports, err := portsToPortSet(info.Config.ExposedPorts)
+	if err != nil {
+		return nil, err
+	}
 
 	// TODO: many fields in Config still need wiring
-	config := dockerSpec.DockerOCIImageConfig{
-		ImageConfig: imageSpec.ImageConfig{
-			User:         info.User,
-			ExposedPorts: info.Config.ExposedPorts,
-			Env:          info.Config.Env,
-			Cmd:          info.Config.Cmd,
-			Volumes:      info.Config.Volumes,
-			WorkingDir:   info.Config.WorkingDir,
-			Entrypoint:   info.Config.Entrypoint,
-			Labels:       info.Labels,
-			StopSignal:   info.Config.StopSignal,
-		},
+	config := dockerContainer.Config{
+		User:         info.User,
+		ExposedPorts: ports,
+		Env:          info.Config.Env,
+		Cmd:          info.Config.Cmd,
+		Volumes:      info.Config.Volumes,
+		WorkingDir:   info.Config.WorkingDir,
+		Entrypoint:   info.Config.Entrypoint,
+		Labels:       info.Labels,
+		StopSignal:   info.Config.StopSignal,
 	}
 
 	rootfs := dockerImage.RootFS{}
@@ -421,6 +422,33 @@ func imageDataToImageInspect(ctx context.Context, l *libimage.Image, r *http.Req
 	return &handlers.ImageInspect{InspectResponse: dockerImageInspect}, nil
 }
 
+// portsToPortSet converts libpod's exposed ports to docker's structs
+func portsToPortSet(input map[string]struct{}) (nat.PortSet, error) {
+	ports := make(nat.PortSet)
+	for k := range input {
+		proto, port := nat.SplitProtoPort(k)
+		switch proto {
+		// See the OCI image spec for details:
+		// https://github.com/opencontainers/image-spec/blob/e562b04403929d582d449ae5386ff79dd7961a11/config.md#properties
+		case "tcp", "":
+			p, err := nat.NewPort("tcp", port)
+			if err != nil {
+				return nil, fmt.Errorf("unable to create tcp port from %s: %w", k, err)
+			}
+			ports[p] = struct{}{}
+		case "udp":
+			p, err := nat.NewPort("udp", port)
+			if err != nil {
+				return nil, fmt.Errorf("unable to create tcp port from %s: %w", k, err)
+			}
+			ports[p] = struct{}{}
+		default:
+			return nil, fmt.Errorf("invalid port proto %q in %q", proto, k)
+		}
+	}
+	return ports, nil
+}
+
 func GetImages(w http.ResponseWriter, r *http.Request) {
 	decoder := utils.GetDecoder(r)
 	runtime := r.Context().Value(api.RuntimeKey).(*libpod.Runtime)
diff --git a/pkg/api/handlers/compat/info.go b/pkg/api/handlers/compat/info.go
index cb3fa79..297bf72 100644
--- a/pkg/api/handlers/compat/info.go
+++ b/pkg/api/handlers/compat/info.go
@@ -56,6 +56,8 @@ func GetInfo(w http.ResponseWriter, r *http.Request) {
 	info := &handlers.Info{
 		Info: dockerSystem.Info{
 			Architecture:        goRuntime.GOARCH,
+			BridgeNfIP6tables:   !sysInfo.BridgeNFCallIP6TablesDisabled,
+			BridgeNfIptables:    !sysInfo.BridgeNFCallIPTablesDisabled,
 			CPUCfsPeriod:        sysInfo.CPUCfsPeriod,
 			CPUCfsQuota:         sysInfo.CPUCfsQuota,
 			CPUSet:              sysInfo.Cpuset,
diff --git a/pkg/api/handlers/compat/system.go b/pkg/api/handlers/compat/system.go
index b839272..2688d8d 100644
--- a/pkg/api/handlers/compat/system.go
+++ b/pkg/api/handlers/compat/system.go
@@ -14,7 +14,6 @@ import (
 	"github.com/containers/podman/v5/pkg/domain/entities"
 	"github.com/containers/podman/v5/pkg/domain/infra/abi"
 	docker "github.com/docker/docker/api/types"
-	"github.com/docker/docker/api/types/build"
 	"github.com/docker/docker/api/types/container"
 	dockerImage "github.com/docker/docker/api/types/image"
 	"github.com/docker/docker/api/types/volume"
@@ -103,6 +102,7 @@ func GetDiskUsage(w http.ResponseWriter, r *http.Request) {
 		Images:     imgs,
 		Containers: ctnrs,
 		Volumes:    vols,
-		BuildCache: []*build.CacheRecord{},
+		BuildCache:  []*docker.BuildCache{},
+		BuilderSize: 0,
 	}})
 }