Skip to content

Commit

Permalink
progress: fix missing last progress from loading layers
Browse files Browse the repository at this point in the history
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
  • Loading branch information
tonistiigi committed Dec 20, 2024
1 parent 5c5bc51 commit 875e717
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions util/dockerutil/progress.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,19 +55,21 @@ func fromReader(l progress.SubLogger, rc io.ReadCloser) error {
Started: &now,
}
}
timeDelta := time.Since(st.Timestamp)
if timeDelta < minTimeDelta {
continue
}
st.Timestamp = time.Now()
if jm.Status == "Loading layer" {
st.Current = jm.Progress.Current
st.Total = jm.Progress.Total
}
now := time.Now()
if jm.Error != nil {
now := time.Now()
st.Completed = &now
} else {
timeDelta := time.Since(st.Timestamp)
if timeDelta < minTimeDelta {
started[id] = st
continue
}
}
st.Timestamp = now
started[id] = st
l.SetStatus(&st)
}
Expand Down

0 comments on commit 875e717

Please # to comment.