Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Added logs for held packages #616

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

NeerajNagure
Copy link

Added logs for the packages that were held by apt

Closes #496

Signed-off-by: Neeraj Nagure <nagureneeraj@gmail.com>
Copy link

codecov bot commented May 10, 2024

Codecov Report

Attention: Patch coverage is 0% with 7 lines in your changes are missing coverage. Please review.

Project coverage is 33.66%. Comparing base (2602d59) to head (86bfff5).
Report is 63 commits behind head on main.

Files Patch % Lines
pkg/pkgmgr/dpkg.go 0.00% 7 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #616      +/-   ##
==========================================
+ Coverage   32.51%   33.66%   +1.15%     
==========================================
  Files          17       18       +1     
  Lines        1621     1521     -100     
==========================================
- Hits          527      512      -15     
+ Misses       1062      976      -86     
- Partials       32       33       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

const heldCmd = `sh -c "apt-mark showhold"`
aptHeld := aptUpdated.Dir(resultsPath).Run(llb.Shlex(heldCmd)).Root()
heldPackagesBytes, err := buildkit.ExtractFileFromState(ctx, dm.config.Client, &aptHeld, resultsPath)
if err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

looks like you are receiving this error: Error: read /tmp/buildkit-mount1189165548/copa-out: is a directory since resultsPath (copa-out) is a directory. You would need to save the output of the heldCmd to a file first and read that file.

Copy link
Author

Choose a reason for hiding this comment

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

@ashnamehrotra I have fixed the error and also I save the output of the cmd in statusdOutputFile and then read it

Copy link
Contributor

Choose a reason for hiding this comment

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

thanks! I think it would be better if we saved it to a new file, since we are using statusdOutputFile to determine whether or not the image is distroless.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🆕 New
Development

Successfully merging this pull request may close these issues.

[REQ] log for held packages
2 participants