-
Notifications
You must be signed in to change notification settings - Fork 70
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: update all - check for upgradable packages #644
feat: update all - check for upgradable packages #644
Conversation
Signed-off-by: ashnamehrotra <[email protected]>
Signed-off-by: ashnamehrotra <[email protected]>
…ilable to include revision nums Signed-off-by: ashnamehrotra <[email protected]>
Signed-off-by: ashnamehrotra <[email protected]>
Signed-off-by: ashnamehrotra <[email protected]>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #644 +/- ##
==========================================
+ Coverage 32.51% 33.01% +0.50%
==========================================
Files 17 18 +1
Lines 1621 1578 -43
==========================================
- Hits 527 521 -6
+ Misses 1062 1024 -38
- Partials 32 33 +1 ☔ View full report in Codecov by Sentry. |
Signed-off-by: ashnamehrotra <[email protected]>
Signed-off-by: ashnamehrotra <[email protected]>
For dnf based distros, have you tried using the tooling image and mounting the rootfs of the image you want to check? Rough example: llb.Image(myToolingImage).Run(
llb.AddMount(rootfsToCheck, "/tmp/rootfs"),
llb.Args([]string{"sh", "-c", "dnf --installroot=/tmp/rootfs check-update"}) |
I say dnf, any distro that uses rpm+yum/dnf style repos and configs. |
Signed-off-by: ashnamehrotra <[email protected]>
I made the changes to get this to work and was able to test it with yum based images. However, for microdnf based images (like quay.io/calico/cni:v3.15.1) it will always detect no upgrade when using dnf, even if the image is unpatched and would detect upgrades when running |
That is interesting and I wonder if that is related to this:
ref: https://www.man7.org/linux/man-pages/man8/dnf.8.html It could be falling back to the tooling image's repo config and/or dnf config. |
We investigated this a bit yesterday and it looks like The work-around we discussed is to solve an intermediate LLB state with dnf installed in the target image and run it like normal and write some file to the rootfs that we'll extract to determine if there are updates. |
Signed-off-by: ashnamehrotra <[email protected]>
Signed-off-by: ashnamehrotra <[email protected]>
Signed-off-by: ashnamehrotra <[email protected]>
Signed-off-by: ashnamehrotra <[email protected]>
…rom check Signed-off-by: ashnamehrotra <[email protected]>
Signed-off-by: ashnamehrotra <[email protected]>
@sozercan in order to end patching workflow, we need to return an error when there are no upgradable packages (similar to with scanner https://github.com/project-copacetic/copacetic/blob/main/pkg/pkgmgr/pkgmgr.go#L51-L54). Do we want to change this in all places? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks!
Adds a check for upgradable packages before updating all when patching without scanner input.
Wanted feedback for microdnf check - discussed with @cpuguy83 to install dnf to call check-update option since microdnf does not support it, but the only way to remove it after is with
rpm -e dnf
.Describe the changes in this pull request using active verbs such as Add, Remove, Replace ...
Closes #594