Skip to content

deploy: fix progress bar math for containers-storage transport#2067

Merged
gursewak1997 merged 1 commit intobootc-dev:mainfrom
andrewdunndev:fix/progress-math-containers-storage
Mar 13, 2026
Merged

deploy: fix progress bar math for containers-storage transport#2067
gursewak1997 merged 1 commit intobootc-dev:mainfrom
andrewdunndev:fix/progress-math-containers-storage

Conversation

@andrewdunndev
Copy link
Contributor

When pulling from containers-storage, layers are stored uncompressed but the progress bar total was set from the manifest descriptor size (compressed). This caused the display to show transferred exceeding total, e.g. 2.66 GiB/1.14 GiB.

The fix updates the byte progress bar length from LayerProgress.total on each progress update, which reflects the actual blob size for the current transport. For registry pulls this equals the manifest descriptor size (compressed), so the change is a no-op in that case. For containers-storage and docker-daemon, it uses the uncompressed size, matching what ProgressReader actually tracks.

Also updates the layer completion path to use the bar's actual length for total_read and subtask accounting, so that completion events report bytes == bytes_total consistently.

This aligns with how ostree-ext's CLI handles the same progress (cli.rs already calls pb.set_length(bytes.total) before pb.set_position(bytes.fetched)).

Closes #2001

When pulling from containers-storage, layers are stored uncompressed but
the progress bar total was set from the manifest descriptor size
(compressed). This caused the display to show transferred exceeding
total, e.g. '2.66 GiB/1.14 GiB'.

Update the byte progress bar length from LayerProgress.total on each
update, which reflects the actual blob size for the transport. Also use
the bar's actual length for completion accounting so that total_read and
subtask bytes are consistent. This matches how ostree-ext's CLI handles
the same progress (cli.rs).

For registry pulls, LayerProgress.total equals the manifest descriptor
size, so this is a no-op in that case.

Closes: bootc-dev#2001
Signed-off-by: Andrew Dunn <andrew@dunn.dev>
@bootc-bot bootc-bot bot requested a review from gursewak1997 March 13, 2026 21:12
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request addresses an issue where the progress bar for container image pulls from transports like containers-storage would show incorrect totals. This was caused by using the compressed layer size from the manifest, while the actual data transferred is uncompressed.

The changes fix this by updating the progress bar's total length with the actual blob size as progress is reported. The layer completion logic is also adjusted to use this corrected size for its final accounting, ensuring consistency.

The changes appear to correctly implement the fix for the described problem. The logic is self-contained within the progress handling function.

Copy link
Contributor

@gursewak1997 gursewak1997 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this fix.
lgtm

@gursewak1997 gursewak1997 enabled auto-merge (squash) March 13, 2026 21:34
@gursewak1997 gursewak1997 merged commit 48124b0 into bootc-dev:main Mar 13, 2026
44 of 48 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Progress math is wrong

2 participants