Skip to content

Commit

Permalink
Merge pull request containers#12951 from rhatdan/commit
Browse files Browse the repository at this point in the history
Fix #2 for compat commit handling of --changes
  • Loading branch information
openshift-merge-robot authored Jan 21, 2022
2 parents 6e17158 + 653da8f commit e3ea996
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
18 changes: 9 additions & 9 deletions pkg/api/handlers/compat/images.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,13 @@ func CommitContainer(w http.ResponseWriter, r *http.Request) {
runtime := r.Context().Value(api.RuntimeKey).(*libpod.Runtime)

query := struct {
Author string `schema:"author"`
Changes string `schema:"changes"`
Comment string `schema:"comment"`
Container string `schema:"container"`
Pause bool `schema:"pause"`
Repo string `schema:"repo"`
Tag string `schema:"tag"`
Author string `schema:"author"`
Changes []string `schema:"changes"`
Comment string `schema:"comment"`
Container string `schema:"container"`
Pause bool `schema:"pause"`
Repo string `schema:"repo"`
Tag string `schema:"tag"`
// fromSrc string # fromSrc is currently unused
}{
Tag: "latest",
Expand Down Expand Up @@ -138,8 +138,8 @@ func CommitContainer(w http.ResponseWriter, r *http.Request) {
options.Message = query.Comment
options.Author = query.Author
options.Pause = query.Pause
if query.Changes != "" {
options.Changes = strings.Split(query.Changes, ",")
for _, change := range query.Changes {
options.Changes = append(options.Changes, strings.Split(change, "\n")...)
}
ctr, err := runtime.LookupContainer(query.Container)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion test/apiv2/20-containers.at
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ cid=$(jq -r '.Id' <<<"$output")
t POST "commit?container=nonesuch" 404

cparam="repo=newrepo&tag=v3&comment=abcd&author=eric"
cparam="$cparam&format=docker&changes=CMD=/bin/bar,EXPOSE=9090"
cparam="$cparam&format=docker&changes=CMD%20/bin/bar%0aEXPOSE%209090"
t POST "commit?container=${cid:0:12}&$cparam" 201 \
.Id~[0-9a-f]\\{64\\}
iid=$(jq -r '.Id' <<<"$output")
Expand Down

0 comments on commit e3ea996

Please sign in to comment.