fix: progress percent overflow in image push (#153)

This commit is contained in:
Luis Lavena
2025-10-22 14:52:57 +10:00
committed by GitHub
parent 9a0b1a4ce3
commit 0153e9f9e2
+5
View File
@@ -472,6 +472,11 @@ func toPushProgressEvent(jm jsonmessage.JSONMessage) *progress.Event {
if jm.Progress.Total > 0 {
percent = int(jm.Progress.Current * 100 / jm.Progress.Total)
// Cap percent at 100 to prevent index out of bounds in progress display.
// Docker can report Current > Total in some cases (e.g., compression).
if percent > 100 {
percent = 100
}
}
switch jm.Status {