Skip to content
This repository was archived by the owner on Sep 30, 2025. It is now read-only.

Commit 2850952

Browse files
authored
Merge pull request #18 from dreadnode/fix/eng-280-fix-cli-progress-bar-percentages
fix: normalize progress percentage to handle docker client weirdness (ENG-280)
2 parents e128242 + 90c072b commit 2850952

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

dreadnode_cli/agent/docker.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,8 @@ def render(self) -> Text:
125125
current = line["progressDetail"].get("current", 0)
126126
total = line["progressDetail"].get("total", 0)
127127
if total > 0:
128-
percentage = (current / total) * 100
128+
# (ENG-280) sometimes docker returns not entirely synced current vs totals
129+
percentage = min((current / total) * 100, 100.0)
129130
output.append(f" {percentage:.1f}%", style="cyan")
130131

131132
output.append("\n")

0 commit comments

Comments
 (0)