Skip to content

Commit 93de899

Browse files
committed
fix: consume ImagePushResponse
1 parent 6708e33 commit 93de899

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

modules/registry/registry.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,15 +192,20 @@ func (c *RegistryContainer) PushImage(ctx context.Context, ref string) error {
192192
return fmt.Errorf("failed to encode image auth: %w", err)
193193
}
194194

195-
_, err = dockerCli.ImagePush(ctx, ref, client.ImagePushOptions{
195+
output, err := dockerCli.ImagePush(ctx, ref, client.ImagePushOptions{
196196
All: true,
197197
RegistryAuth: encodedAuth,
198198
})
199199
if err != nil {
200200
return fmt.Errorf("push image %q: %w", ref, err)
201201
}
202+
defer output.Close()
203+
204+
if err := output.Wait(ctx); err != nil {
205+
return fmt.Errorf("push image %q: %w", ref, err)
206+
}
202207

203-
return c.ImageExists(ctx, ref)
208+
return nil
204209
}
205210

206211
// PullImage pulls an image from an external registry into the local Docker daemon.

0 commit comments

Comments
 (0)