image convert: add progress bar output#4658
Conversation
|
Thank you for creating the PR! First, could you please run lint and push again? |
|
ping @akoul-05 |
|
I can take this, looks inactive :) @AkihiroSuda |
Thanks, feel free to open a new PR |
argusdev-bot
left a comment
There was a problem hiding this comment.
Argus Code Review
Score: 95/100
Reviewed 3 files. Found 1 issues. Score: 95/100.
Additional Findings
These findings are on lines outside the diff and cannot be shown inline.
- [MEDIUM] SOCI conversion bypasses progress tracking and error cleanup
When SOCI conversion is selected, the function returns early at line 185, bypassing the newly added progress tracking goroutine and its cleanup logic. This leaves the goroutine running indefinitely if progress output was enabled, causing a goroutine leak and potential resource exhaustion. An attacker could trigger repeated SOCI conversions with progress output to exhaust system resources.
Justification: The SOCI conversion case returns early via return printConvertedImage(...) at line 185, but lines 216-228 (added in the new version) start a goroutine for progress tracking when options.ProgressOutput != nil. This goroutine will never be cancelled because the early return skips the cancellation logic at lines 233-236 and 240-243.
Validation: Line 185: return printConvertedImage(options.Stdout, options, res) exits the function. Lines 233-236: if cancelProgress != nil { cancelProgress(); <-progressDone } only executes if converterutil.Convert returns an error. Lines 240-243: same cancellation logic only runs after successful conversion. Since SOCI conversion returns early, neither cancellation block is reached, leaving the goroutine from line 224 running.
Suggestion: Move the SOCI conversion logic after the progress tracking setup or ensure the progress tracking is properly cleaned up before the early return. (pkg/cmd/image/convert.go:176)
Added features to progress tracker to show status during image convert. Added image descriptors manifest/layer/config.
Relates to #4528