mirror of
https://github.com/containers/podman.git
synced 2025-06-25 12:20:42 +08:00
Merge pull request #12951 from rhatdan/commit
Fix #2 for compat commit handling of --changes
This commit is contained in:
@ -98,7 +98,7 @@ func CommitContainer(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
query := struct {
|
||||
Author string `schema:"author"`
|
||||
Changes string `schema:"changes"`
|
||||
Changes []string `schema:"changes"`
|
||||
Comment string `schema:"comment"`
|
||||
Container string `schema:"container"`
|
||||
Pause bool `schema:"pause"`
|
||||
@ -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 {
|
||||
|
@ -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")
|
||||
|
Reference in New Issue
Block a user