summaryrefslogtreecommitdiff
path: root/pkg/api
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2022-02-23 13:07:00 -0500
committerGitHub <noreply@github.com>2022-02-23 13:07:00 -0500
commit991c90de1fca66e7c99b864816d0292dd33b73dc (patch)
treefc405d7a90ae4d3f755a4760c17f3d84e94550f7 /pkg/api
parent113f855802176a4ffbe167304ab83942116a65f1 (diff)
parentfbbcb957c710ab817c969a8dc3ff3c46619604e2 (diff)
downloadpodman-991c90de1fca66e7c99b864816d0292dd33b73dc.tar.gz
podman-991c90de1fca66e7c99b864816d0292dd33b73dc.tar.bz2
podman-991c90de1fca66e7c99b864816d0292dd33b73dc.zip
Merge pull request #13314 from flouthoc/container-commit-squash
container-commit: support `--squash` to squash layers into one if users want.
Diffstat (limited to 'pkg/api')
-rw-r--r--pkg/api/handlers/compat/images.go2
-rw-r--r--pkg/api/handlers/libpod/images.go2
-rw-r--r--pkg/api/server/register_images.go4
3 files changed, 8 insertions, 0 deletions
diff --git a/pkg/api/handlers/compat/images.go b/pkg/api/handlers/compat/images.go
index 3546f88a0..edefce010 100644
--- a/pkg/api/handlers/compat/images.go
+++ b/pkg/api/handlers/compat/images.go
@@ -102,6 +102,7 @@ func CommitContainer(w http.ResponseWriter, r *http.Request) {
Comment string `schema:"comment"`
Container string `schema:"container"`
Pause bool `schema:"pause"`
+ Squash bool `schema:"squash"`
Repo string `schema:"repo"`
Tag string `schema:"tag"`
// fromSrc string # fromSrc is currently unused
@@ -138,6 +139,7 @@ func CommitContainer(w http.ResponseWriter, r *http.Request) {
options.Message = query.Comment
options.Author = query.Author
options.Pause = query.Pause
+ options.Squash = query.Squash
for _, change := range query.Changes {
options.Changes = append(options.Changes, strings.Split(change, "\n")...)
}
diff --git a/pkg/api/handlers/libpod/images.go b/pkg/api/handlers/libpod/images.go
index f078c13cc..eb9fb12a6 100644
--- a/pkg/api/handlers/libpod/images.go
+++ b/pkg/api/handlers/libpod/images.go
@@ -497,6 +497,7 @@ func CommitContainer(w http.ResponseWriter, r *http.Request) {
Container string `schema:"container"`
Format string `schema:"format"`
Pause bool `schema:"pause"`
+ Squash bool `schema:"squash"`
Repo string `schema:"repo"`
Tag string `schema:"tag"`
}{
@@ -543,6 +544,7 @@ func CommitContainer(w http.ResponseWriter, r *http.Request) {
options.Message = query.Comment
options.Author = query.Author
options.Pause = query.Pause
+ options.Squash = query.Squash
options.Changes = query.Changes
ctr, err := runtime.LookupContainer(query.Container)
if err != nil {
diff --git a/pkg/api/server/register_images.go b/pkg/api/server/register_images.go
index d7bc17093..017310f12 100644
--- a/pkg/api/server/register_images.go
+++ b/pkg/api/server/register_images.go
@@ -460,6 +460,10 @@ func (s *APIServer) registerImagesHandlers(r *mux.Router) error {
// name: changes
// type: string
// description: instructions to apply while committing in Dockerfile format
+ // - in: query
+ // name: squash
+ // type: boolean
+ // description: squash newly built layers into a single new layer
// produces:
// - application/json
// responses: