Browse Source

report cancelled pull after another one failed

Signed-off-by: Nicolas De Loof <[email protected]>
Nicolas De Loof 6 months ago
parent
commit
7f9101845d
1 changed files with 10 additions and 0 deletions
  1. 10 0
      pkg/compose/pull.go

+ 10 - 0
pkg/compose/pull.go

@@ -204,6 +204,16 @@ func (s *composeService) pullServiceImage(ctx context.Context, service types.Ser
 		Platform:     platform,
 	})
 
+	if ctx.Err() != nil {
+		w.Event(progress.Event{
+			ID:         service.Name,
+			Status:     progress.Warning,
+			Text:       "Warning",
+			StatusText: "Interrupted",
+		})
+		return "", nil
+	}
+
 	// check if has error and the service has a build section
 	// then the status should be warning instead of error
 	if err != nil && service.Build != nil {