Skip to content

Commit 419a031

Browse files
Merge pull request #26789 from mheon/560_rc2_backports
Backports for Podman v5.6.0-RC2
2 parents 3809ca0 + 44e1f1e commit 419a031

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+1320
-195
lines changed

RELEASE_NOTES.md

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
- The `--mount` option to `podman create` and `podman run` now supports `dest=` as a valid alias for `destination=`.
1212
- The `podman kube play` command can now restrict container execution to specific CPU cores and specific memory nodes using the `io.podman.annotations.cpuset/$ctrname` and `io.podman.annotations.memory-nodes/$ctrname` annotations ([#26172](https://github.com/containers/podman/issues/26172)).
1313
- The `podman kube play` command now supports the `lifecycle.stopSignal` field in Pod YAML, allowing the signal used to stop containers to be specified ([#25389](https://github.com/containers/podman/issues/25389)).
14+
- The `podman artifact` suite of commands for interacting with OCI artifacts is now available in the remote Podman client and the bindings for the REST API.
1415
- The `podman volume import` and `podman volume export` commands are now available in the remote Podman client ([#26049](https://github.com/containers/podman/issues/26409)).
1516
- The `--build-context` option to `podman build` is now supported by the remote Podman client ([#23433](https://github.com/containers/podman/issues/23433)).
1617
- The `podman volume create` command now accepts two new options, `--uid` and `--gid`, to set the UID and GID the volume will be created with.
@@ -22,6 +23,7 @@
2223
- A new command, `podman buildx inspect`, has been added to improve Docker compatibility ([#13014](https://github.com/containers/podman/issues/13014)).
2324

2425
### Changes
26+
- The `podman artifact` suite of commands for interacting with OCI artifacts is now considered stable.
2527
- For users running `podman machine` VMs using the `libkrun` provider on an M3 or newer host running macOS 15+, nested virtualization is enabled by default.
2628
- When creating `podman machine` VMs on Windows using the WSL v2 provider, images are now pulled as artifacts from `quay.io/podman/machine-os`, matching the behavior of other VM providers.
2729
- Signal forwarding done by the `--sig-proxy` option to `podman run` and `podman attach` is now more robust to races and no longer forwards the `SIGSTOP` signal.
@@ -58,7 +60,11 @@
5860
- A full set of API endpoints for interacting with artifacts has been added, including inspecting artifacts (`GET /libpod/artifacts/{name}/json`), listing all artifacts (`GET /libpod/artifacts/json`), pulling an artifact (`POST /libpod/artifacts/pull`), removing an artifact (`DELETE /libpod/artifacts/{name}`), adding an artifact (or appending to an existing artifact) from a tar file in the request body (`POST /libpod/artifacts/add`), pushing an artifact to a registry (`/libpod/artifacts/{name}/push`), and retrieving the contents of an artifact (`GET /libpod/artifacts/{name}/extract`).
5961
- The Compat Create endpoint for Containers now accepts a new parameter, `HostConfig.CgroupnsMode`, to specify the cgroup namespace mode of the created container.
6062
- The Compat Create endpoint for Containers now respects the `base_hosts_file` option in `containers.conf`.
61-
- The Compat Info endpoint now returns a new field, `DefaultAddressPools`.
63+
- The Compat System Info endpoint now returns a new field, `DefaultAddressPools`.
64+
- The Compat System DF endpoint has removed the deprecated `BuilderSize` field.
65+
- The Compat Ping endpoint now sets `Builder-Version` to `1` to match Docker installs that do not include BuildKit.
66+
- The Compat List endpoint for Images now returns the `shared-size` field unconditionally, even if the `shared-size` query parameter was not set to true. If not requested through query parameter, it is set to `-1`. This improves Docker API compatibility.
67+
- The Compat Inspect endpoint for Images now no longer returns the deprecated `VirtualSize` field when Docker API version 1.44 and up is requested.
6268
- Fixed a bug where the Compat Delete API for Containers would remove running containers when the `FORCE` parameter was set to true; Docker only removes stopped containers ([#25871](https://github.com/containers/podman/issues/25871)).
6369
- Fixed a bug where the Compat List and Compat Inspect endpoints for Containers returned container status using Podman statuses instead of converting to Docker-compatible statuses ([#17728](https://github.com/containers/podman/issues/17728)).
6470
- Fixed a bug where healthchecks that exceeded their timeout were not properly terminated; they now receive SIGTERM, then SIGKILL after a delay, if their timeout is exceeded ([#26086](https://github.com/containers/podman/pull/26086)).
@@ -67,10 +73,10 @@
6773
### Misc
6874
- Quadlet now no longer uses container/pod ID files when stopping containers, but instead passes the name of the container/pod directly to `podman stop`/`podman pod stop`.
6975
- When building Podman via Makefile, it will now attempt to dynamically link sqlite3 if the library and header are installed locally. This and other optimizations should result in a significant reduction in binary size relative to Podman 5.5.x. Packagers can use the `libsqlite3` build tag to force this behavior when not using the Makefile to build.
70-
- Updated Buildah to v1.41.0
71-
- Updated the containers/common library to v0.64.0
72-
- Updated the containers/storage library to v1.59.0
73-
- Updated the containers/image library to v5.36.0
76+
- Updated Buildah to v1.41.1
77+
- Updated the containers/common library to v0.64.1
78+
- Updated the containers/storage library to v1.59.1
79+
- Updated the containers/image library to v5.36.1
7480

7581
## 5.5.2
7682
### Security

cmd/podman/artifact/add.go

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -23,20 +23,17 @@ var (
2323
Example: `podman artifact add quay.io/myimage/myartifact:latest /tmp/foobar.txt
2424
podman artifact add --file-type text/yaml quay.io/myimage/myartifact:latest /tmp/foobar.yaml
2525
podman artifact add --append quay.io/myimage/myartifact:latest /tmp/foobar.tar.gz`,
26-
Annotations: map[string]string{registry.EngineMode: registry.ABIMode},
2726
}
2827
)
2928

30-
type artifactAddOptions struct {
31-
ArtifactType string
32-
Annotations []string
33-
Append bool
34-
FileType string
29+
// AddOptionsWrapper wraps entities.ArtifactsAddOptions and prevents leaking
30+
// CLI-only fields into the API types.
31+
type AddOptionsWrapper struct {
32+
entities.ArtifactAddOptions
33+
AnnotationsCLI []string // CLI only
3534
}
3635

37-
var (
38-
addOpts artifactAddOptions
39-
)
36+
var addOpts AddOptionsWrapper
4037

4138
func init() {
4239
registry.Commands = append(registry.Commands, registry.CliCommand{
@@ -46,34 +43,36 @@ func init() {
4643
flags := addCmd.Flags()
4744

4845
annotationFlagName := "annotation"
49-
flags.StringArrayVar(&addOpts.Annotations, annotationFlagName, nil, "set an `annotation` for the specified files of artifact")
46+
flags.StringArrayVar(&addOpts.AnnotationsCLI, annotationFlagName, nil, "set an `annotation` for the specified files of artifact")
5047
_ = addCmd.RegisterFlagCompletionFunc(annotationFlagName, completion.AutocompleteNone)
5148

52-
addTypeFlagName := "type"
53-
flags.StringVar(&addOpts.ArtifactType, addTypeFlagName, "", "Use type to describe an artifact")
54-
_ = addCmd.RegisterFlagCompletionFunc(addTypeFlagName, completion.AutocompleteNone)
49+
addMIMETypeFlagName := "type"
50+
flags.StringVar(&addOpts.ArtifactMIMEType, addMIMETypeFlagName, "", "Use type to describe an artifact")
51+
_ = addCmd.RegisterFlagCompletionFunc(addMIMETypeFlagName, completion.AutocompleteNone)
5552

5653
appendFlagName := "append"
5754
flags.BoolVarP(&addOpts.Append, appendFlagName, "a", false, "Append files to an existing artifact")
5855

59-
fileTypeFlagName := "file-type"
60-
flags.StringVarP(&addOpts.FileType, fileTypeFlagName, "", "", "Set file type to use for the artifact (layer)")
61-
_ = addCmd.RegisterFlagCompletionFunc(fileTypeFlagName, completion.AutocompleteNone)
56+
fileMIMETypeFlagName := "file-type"
57+
flags.StringVarP(&addOpts.FileMIMEType, fileMIMETypeFlagName, "", "", "Set file type to use for the artifact (layer)")
58+
_ = addCmd.RegisterFlagCompletionFunc(fileMIMETypeFlagName, completion.AutocompleteNone)
6259
}
6360

6461
func add(cmd *cobra.Command, args []string) error {
6562
artifactName := args[0]
6663
blobs := args[1:]
67-
opts := new(entities.ArtifactAddOptions)
6864

69-
annots, err := utils.ParseAnnotations(addOpts.Annotations)
65+
annots, err := utils.ParseAnnotations(addOpts.AnnotationsCLI)
7066
if err != nil {
7167
return err
7268
}
73-
opts.Annotations = annots
74-
opts.ArtifactType = addOpts.ArtifactType
75-
opts.Append = addOpts.Append
76-
opts.FileType = addOpts.FileType
69+
70+
opts := entities.ArtifactAddOptions{
71+
Annotations: annots,
72+
ArtifactMIMEType: addOpts.ArtifactMIMEType,
73+
Append: addOpts.Append,
74+
FileMIMEType: addOpts.FileMIMEType,
75+
}
7776

7877
artifactBlobs := make([]entities.ArtifactBlob, 0, len(blobs))
7978

cmd/podman/artifact/artifact.go

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,13 @@ import (
66
"github.com/spf13/cobra"
77
)
88

9-
var (
10-
// Command: podman _artifact_
11-
artifactCmd = &cobra.Command{
12-
Use: "artifact",
13-
Short: "Manage OCI artifacts",
14-
Long: "Manage OCI artifacts",
15-
RunE: validate.SubCommandExists,
16-
Annotations: map[string]string{registry.EngineMode: registry.ABIMode},
17-
}
18-
)
9+
// Command: podman _artifact_
10+
var artifactCmd = &cobra.Command{
11+
Use: "artifact",
12+
Short: "Manage OCI artifacts",
13+
Long: "Manage OCI artifacts",
14+
RunE: validate.SubCommandExists,
15+
}
1916

2017
func init() {
2118
registry.Commands = append(registry.Commands, registry.CliCommand{

cmd/podman/artifact/extract.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ var (
1818
ValidArgsFunction: common.AutocompleteArtifactAdd,
1919
Example: `podman artifact Extract quay.io/myimage/myartifact:latest /tmp/foobar.txt
2020
podman artifact Extract quay.io/myimage/myartifact:latest /home/paul/mydir`,
21-
Annotations: map[string]string{registry.EngineMode: registry.ABIMode},
2221
}
2322
)
2423

@@ -43,7 +42,7 @@ func init() {
4342
}
4443

4544
func extract(cmd *cobra.Command, args []string) error {
46-
err := registry.ImageEngine().ArtifactExtract(registry.Context(), args[0], args[1], &extractOpts)
45+
err := registry.ImageEngine().ArtifactExtract(registry.Context(), args[0], args[1], extractOpts)
4746
if err != nil {
4847
return err
4948
}

cmd/podman/artifact/inspect.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ var (
1717
Args: cobra.MinimumNArgs(1),
1818
ValidArgsFunction: common.AutocompleteArtifacts,
1919
Example: `podman artifact inspect quay.io/myimage/myartifact:latest`,
20-
Annotations: map[string]string{registry.EngineMode: registry.ABIMode},
2120
}
2221
)
2322

cmd/podman/artifact/list.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ var (
2525
Args: validate.NoArgs,
2626
ValidArgsFunction: completion.AutocompleteNone,
2727
Example: `podman artifact ls`,
28-
Annotations: map[string]string{registry.EngineMode: registry.ABIMode},
2928
}
3029
listFlag = listFlagType{}
3130
)

cmd/podman/artifact/pull.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ var (
3636
Args: cobra.ExactArgs(1),
3737
ValidArgsFunction: common.AutocompleteArtifacts,
3838
Example: `podman artifact pull quay.io/myimage/myartifact:latest`,
39-
Annotations: map[string]string{registry.EngineMode: registry.ABIMode},
4039
}
4140
)
4241

cmd/podman/artifact/push.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ var (
4040
Args: cobra.ExactArgs(1),
4141
ValidArgsFunction: common.AutocompleteArtifacts,
4242
Example: `podman artifact push quay.io/myimage/myartifact:latest`,
43-
Annotations: map[string]string{registry.EngineMode: registry.ABIMode},
4443
}
4544
)
4645

cmd/podman/artifact/rm.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ var (
2323
ValidArgsFunction: common.AutocompleteArtifacts,
2424
Example: `podman artifact rm quay.io/myimage/myartifact:latest
2525
podman artifact rm -a`,
26-
Annotations: map[string]string{registry.EngineMode: registry.ABIMode},
2726
}
2827

2928
rmOptions = entities.ArtifactRemoveOptions{}

pkg/api/handlers/compat/images.go

Lines changed: 33 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import (
1919
"github.com/containers/podman/v5/libpod"
2020
"github.com/containers/podman/v5/pkg/api/handlers"
2121
"github.com/containers/podman/v5/pkg/api/handlers/utils"
22+
"github.com/containers/podman/v5/pkg/api/handlers/utils/apiutil"
2223
api "github.com/containers/podman/v5/pkg/api/types"
2324
"github.com/containers/podman/v5/pkg/auth"
2425
"github.com/containers/podman/v5/pkg/domain/entities"
@@ -340,15 +341,15 @@ func GetImage(w http.ResponseWriter, r *http.Request) {
340341
utils.Error(w, http.StatusNotFound, fmt.Errorf("failed to find image %s: %s", name, errMsg))
341342
return
342343
}
343-
inspect, err := imageDataToImageInspect(r.Context(), newImage)
344+
inspect, err := imageDataToImageInspect(r.Context(), newImage, r)
344345
if err != nil {
345346
utils.Error(w, http.StatusInternalServerError, fmt.Errorf("failed to convert ImageData to ImageInspect '%s': %w", name, err))
346347
return
347348
}
348349
utils.WriteResponse(w, http.StatusOK, inspect)
349350
}
350351

351-
func imageDataToImageInspect(ctx context.Context, l *libimage.Image) (*handlers.ImageInspect, error) {
352+
func imageDataToImageInspect(ctx context.Context, l *libimage.Image, r *http.Request) (*handlers.ImageInspect, error) {
352353
options := &libimage.InspectOptions{WithParent: true, WithSize: true}
353354
info, err := l.Inspect(ctx, options)
354355
if err != nil {
@@ -407,18 +408,24 @@ func imageDataToImageInspect(ctx context.Context, l *libimage.Image) (*handlers.
407408
RootFS: rootfs,
408409
Size: info.Size,
409410
Variant: "",
410-
VirtualSize: info.VirtualSize,
411411
}
412+
413+
if _, err := apiutil.SupportedVersion(r, "<1.44.0"); err == nil {
414+
//nolint:staticcheck // Deprecated field
415+
dockerImageInspect.VirtualSize = info.VirtualSize
416+
}
417+
412418
return &handlers.ImageInspect{InspectResponse: dockerImageInspect}, nil
413419
}
414420

415421
func GetImages(w http.ResponseWriter, r *http.Request) {
416422
decoder := utils.GetDecoder(r)
417423
runtime := r.Context().Value(api.RuntimeKey).(*libpod.Runtime)
418424
query := struct {
419-
All bool
420-
Digests bool
421-
Filter string // Docker 1.24 compatibility
425+
All bool
426+
Digests bool
427+
Filter string // Docker 1.24 compatibility
428+
SharedSize bool `schema:"shared-size"` // Docker 1.42 compatibility
422429
}{
423430
// This is where you can override the golang default value for one of fields
424431
}
@@ -468,6 +475,26 @@ func GetImages(w http.ResponseWriter, r *http.Request) {
468475
// docker adds sha256: in front of the ID
469476
for _, s := range summaries {
470477
s.ID = "sha256:" + s.ID
478+
// Ensure RepoTags and RepoDigests are empty arrays instead of null for Docker compatibility
479+
// as per https://docs.docker.com/reference/api/engine/version-history/#v143-api-changes
480+
// Relates to https://issues.redhat.com/browse/RUN-2699
481+
if s.RepoTags == nil {
482+
s.RepoTags = []string{}
483+
}
484+
if s.RepoDigests == nil {
485+
s.RepoDigests = []string{}
486+
}
487+
// Docker 1.42 sets SharedSize to -1 if ont passed explicitly
488+
if !query.SharedSize {
489+
s.SharedSize = -1
490+
}
491+
// VirtualSize is deprecated in version 1.43 and removed in version 1.44
492+
// See https://docs.docker.com/reference/api/engine/version-history/#v143-api-changes
493+
if _, err := apiutil.SupportedVersion(r, "<1.44.0"); err == nil {
494+
s.VirtualSize = s.Size
495+
} else {
496+
s.VirtualSize = 0
497+
}
471498
}
472499
}
473500
utils.WriteResponse(w, http.StatusOK, summaries)

0 commit comments

Comments
 (0)