瀏覽代碼

c8d/pull: Don't emit `Downloading` with 0 progress

To align with the graphdrivers behavior and don't send unnecessary
progress messages.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
Paweł Gronowski 1 年之前
父節點
當前提交
14df52b709
共有 1 個文件被更改,包括 3 次插入0 次删除
  1. 3 0
      daemon/containerd/progress.go

+ 3 - 0
daemon/containerd/progress.go

@@ -135,6 +135,9 @@ func (p pullProgress) UpdateProgress(ctx context.Context, ongoing *jobs, out pro
 		}
 		}
 		key := remotes.MakeRefKey(ctx, j)
 		key := remotes.MakeRefKey(ctx, j)
 		if info, ok := pulling[key]; ok {
 		if info, ok := pulling[key]; ok {
+			if info.Offset == 0 {
+				continue
+			}
 			out.WriteProgress(progress.Progress{
 			out.WriteProgress(progress.Progress{
 				ID:      stringid.TruncateID(j.Digest.Encoded()),
 				ID:      stringid.TruncateID(j.Digest.Encoded()),
 				Action:  "Downloading",
 				Action:  "Downloading",