From 6ea6bf7fa3a7de80f5662c4071ad0a622f3789cb Mon Sep 17 00:00:00 2001 From: Austin Drenski Date: Wed, 24 Jun 2026 19:30:24 -0400 Subject: [PATCH] fix: consume ImagePushResponse --- modules/registry/registry.go | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/modules/registry/registry.go b/modules/registry/registry.go index cffa8f1803..c3b49ea90a 100644 --- a/modules/registry/registry.go +++ b/modules/registry/registry.go @@ -192,7 +192,7 @@ func (c *RegistryContainer) PushImage(ctx context.Context, ref string) error { return fmt.Errorf("failed to encode image auth: %w", err) } - _, err = dockerCli.ImagePush(ctx, ref, client.ImagePushOptions{ + output, err := dockerCli.ImagePush(ctx, ref, client.ImagePushOptions{ All: true, RegistryAuth: encodedAuth, }) @@ -200,7 +200,16 @@ func (c *RegistryContainer) PushImage(ctx context.Context, ref string) error { return fmt.Errorf("push image %q: %w", ref, err) } - return c.ImageExists(ctx, ref) + for m, err := range output.JSONMessages(ctx) { + if err != nil { + return fmt.Errorf("push image %q: %w", ref, err) + } + if err := m.Error; err != nil { + return fmt.Errorf("push image %q: %w", ref, err) + } + } + + return nil } // PullImage pulls an image from an external registry into the local Docker daemon.