diff --git a/pkg/bindings/images/pull.go b/pkg/bindings/images/pull.go index 8caf45c0e1..43592f6e21 100644 --- a/pkg/bindings/images/pull.go +++ b/pkg/bindings/images/pull.go @@ -69,6 +69,7 @@ func Pull(ctx context.Context, rawImage string, options *PullOptions) ([]string, dec := json.NewDecoder(response.Body) var images []string var pullErrors []error +LOOP: for { var report entities.ImagePullReport if err := dec.Decode(&report); err != nil { @@ -80,7 +81,7 @@ func Pull(ctx context.Context, rawImage string, options *PullOptions) ([]string, select { case <-response.Request.Context().Done(): - break + break LOOP default: // non-blocking select } diff --git a/pkg/bindings/images/push.go b/pkg/bindings/images/push.go index 0e1309e919..c04ffbf904 100644 --- a/pkg/bindings/images/push.go +++ b/pkg/bindings/images/push.go @@ -67,6 +67,7 @@ func Push(ctx context.Context, source string, destination string, options *PushO } dec := json.NewDecoder(response.Body) +LOOP: for { var report entities.ImagePushReport if err := dec.Decode(&report); err != nil { @@ -78,7 +79,7 @@ func Push(ctx context.Context, source string, destination string, options *PushO select { case <-response.Request.Context().Done(): - break + break LOOP default: // non-blocking select } diff --git a/pkg/bindings/manifests/manifests.go b/pkg/bindings/manifests/manifests.go index d987e51d80..ed605bd7b2 100644 --- a/pkg/bindings/manifests/manifests.go +++ b/pkg/bindings/manifests/manifests.go @@ -199,7 +199,7 @@ func Push(ctx context.Context, name, destination string, options *images.PushOpt select { case <-response.Request.Context().Done(): - break + return "", context.Canceled default: // non-blocking select }