mirror of
https://github.com/containers/podman.git
synced 2025-06-28 06:18:57 +08:00
Change to correct break statements
Signed-off-by: Jakob Tigerström <jakob.tigerstrom@gmail.com>
This commit is contained in:
@ -69,6 +69,7 @@ func Pull(ctx context.Context, rawImage string, options *PullOptions) ([]string,
|
|||||||
dec := json.NewDecoder(response.Body)
|
dec := json.NewDecoder(response.Body)
|
||||||
var images []string
|
var images []string
|
||||||
var pullErrors []error
|
var pullErrors []error
|
||||||
|
LOOP:
|
||||||
for {
|
for {
|
||||||
var report entities.ImagePullReport
|
var report entities.ImagePullReport
|
||||||
if err := dec.Decode(&report); err != nil {
|
if err := dec.Decode(&report); err != nil {
|
||||||
@ -80,7 +81,7 @@ func Pull(ctx context.Context, rawImage string, options *PullOptions) ([]string,
|
|||||||
|
|
||||||
select {
|
select {
|
||||||
case <-response.Request.Context().Done():
|
case <-response.Request.Context().Done():
|
||||||
break
|
break LOOP
|
||||||
default:
|
default:
|
||||||
// non-blocking select
|
// non-blocking select
|
||||||
}
|
}
|
||||||
|
@ -67,6 +67,7 @@ func Push(ctx context.Context, source string, destination string, options *PushO
|
|||||||
}
|
}
|
||||||
|
|
||||||
dec := json.NewDecoder(response.Body)
|
dec := json.NewDecoder(response.Body)
|
||||||
|
LOOP:
|
||||||
for {
|
for {
|
||||||
var report entities.ImagePushReport
|
var report entities.ImagePushReport
|
||||||
if err := dec.Decode(&report); err != nil {
|
if err := dec.Decode(&report); err != nil {
|
||||||
@ -78,7 +79,7 @@ func Push(ctx context.Context, source string, destination string, options *PushO
|
|||||||
|
|
||||||
select {
|
select {
|
||||||
case <-response.Request.Context().Done():
|
case <-response.Request.Context().Done():
|
||||||
break
|
break LOOP
|
||||||
default:
|
default:
|
||||||
// non-blocking select
|
// non-blocking select
|
||||||
}
|
}
|
||||||
|
@ -199,7 +199,7 @@ func Push(ctx context.Context, name, destination string, options *images.PushOpt
|
|||||||
|
|
||||||
select {
|
select {
|
||||||
case <-response.Request.Context().Done():
|
case <-response.Request.Context().Done():
|
||||||
break
|
return "", context.Canceled
|
||||||
default:
|
default:
|
||||||
// non-blocking select
|
// non-blocking select
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user