client/image_(inspect,history,load,save): Wrap return values

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Paweł Gronowski
2025-10-20 23:37:29 +02:00
committed by Sebastiaan van Stijn
parent 7066eb3736
commit 2d69edd28a
29 changed files with 231 additions and 126 deletions

View File

@@ -886,7 +886,7 @@ func (d *Daemon) LoadImage(ctx context.Context, t testing.TB, img string) {
resp, err := c.ImageLoad(ctx, reader, client.ImageLoadWithQuiet(true))
assert.NilError(t, err, "[%s] failed to load %s", d.id, img)
defer resp.Body.Close()
defer resp.Close()
}
func (d *Daemon) getClientConfig() (*clientConfig, error) {

View File

@@ -114,9 +114,9 @@ func loadFrozenImages(ctx context.Context, apiClient client.APIClient) error {
if err != nil {
return errors.Wrap(err, "failed to load frozen images")
}
defer resp.Body.Close()
defer resp.Close()
fd, isTerminal := term.GetFdInfo(os.Stdout)
return jsonmessage.DisplayJSONMessagesStream(resp.Body, os.Stdout, fd, isTerminal, nil)
return jsonmessage.DisplayJSONMessagesStream(resp, os.Stdout, fd, isTerminal, nil)
}
func pullImages(ctx context.Context, client client.APIClient, images []string) error {