diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-09-21 16:20:30 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-21 16:20:30 -0400 |
commit | d308312fa8101fd843dd6855ee4406b1c4f012ec (patch) | |
tree | b9555a977186f18ed4692f0527ff30b52591da1e /pkg/api/handlers | |
parent | dc5cc4356362274325a5b4fb2ba8ce71b12544dd (diff) | |
parent | e06230c9d5768af3e480e58b8e781e81737fc0d3 (diff) | |
download | podman-d308312fa8101fd843dd6855ee4406b1c4f012ec.tar.gz podman-d308312fa8101fd843dd6855ee4406b1c4f012ec.tar.bz2 podman-d308312fa8101fd843dd6855ee4406b1c4f012ec.zip |
Merge pull request #7695 from jwhonce/issues/7686
Restore 'id' stanza in pull results
Diffstat (limited to 'pkg/api/handlers')
-rw-r--r-- | pkg/api/handlers/libpod/images_pull.go | 9 | ||||
-rw-r--r-- | pkg/api/handlers/types.go | 2 |
2 files changed, 10 insertions, 1 deletions
diff --git a/pkg/api/handlers/libpod/images_pull.go b/pkg/api/handlers/libpod/images_pull.go index 8a2f4f4cf..ad8d1f38e 100644 --- a/pkg/api/handlers/libpod/images_pull.go +++ b/pkg/api/handlers/libpod/images_pull.go @@ -178,10 +178,19 @@ loop: // break out of for/select infinite loop flush() case <-runCtx.Done(): if !failed { + // Send all image id's pulled in 'images' stanza report.Images = images if err := enc.Encode(report); err != nil { logrus.Warnf("Failed to json encode error %q", err.Error()) } + + report.Images = nil + // Pull last ID from list and publish in 'id' stanza. This maintains previous API contract + report.ID = images[len(images)-1] + if err := enc.Encode(report); err != nil { + logrus.Warnf("Failed to json encode error %q", err.Error()) + } + flush() } break loop // break out of for/select infinite loop diff --git a/pkg/api/handlers/types.go b/pkg/api/handlers/types.go index 0ccaa95bb..9e503dbb0 100644 --- a/pkg/api/handlers/types.go +++ b/pkg/api/handlers/types.go @@ -33,7 +33,7 @@ type LibpodImagesLoadReport struct { } type LibpodImagesPullReport struct { - ID string `json:"id"` + entities.ImagePullReport } // LibpodImagesRemoveReport is the return type for image removal via the rest |