-
Notifications
You must be signed in to change notification settings - Fork 69
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: skip install tools cmd #741
feat: skip install tools cmd #741
Conversation
Commented out the hardcoded install command and introduced a new method to dynamically generate the command based on the available package managers and missing tools in the tooling image. This enhancement increases flexibility and ensures the tooling image has all required tools installed using the detected package manager. Signed-off-by: Miaha Cybersec <MiahaCybersec@gmail.com>
Extended the list of package managers to include 'rpm' in the pkgmgr. Added error handling for unsupported RedHat and RockyLinux source policies due to missing busybox in their repos. Signed-off-by: Miaha Cybersec <MiahaCybersec@gmail.com>
Changed `generateToolInstallCmd` to accept pointer of llb.State for better efficiency. Removed redundant `rpm` package manager as it cannot connect to RPM repos. Signed-off-by: Miaha Cybersec <MiahaCybersec@gmail.com>
Currently working on fixing the failing test |
Added `tdnf` as a required package manager in test cases for `Test_unpackAndMergeUpdates_RPM`. This ensures tests do not fail due to the absence of a specified package manager. Signed-off-by: Miaha Cybersec <MiahaCybersec@gmail.com>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #741 +/- ##
==========================================
- Coverage 47.46% 47.43% -0.04%
==========================================
Files 18 18
Lines 1677 1714 +37
==========================================
+ Hits 796 813 +17
- Misses 826 843 +17
- Partials 55 58 +3 ☔ View full report in Codecov by Sentry. |
Simplify the loop for checking required tools by using more descriptive variable names and range iteration syntax. This improves readability and maintainability of the code. Signed-off-by: Miaha Cybersec <MiahaCybersec@gmail.com>
@MiahaCybersec when testing this locally, it does work with a cbl-mariner to Fedora conversion source policy and doesn't work with Redhat conversion (as expected when patching a mariner image). However, I still see "dnf install busybox dnf-utils cpio -y" in the logs with Fedora, which should already have busybox? |
Co-authored-by: Ashna Mehrotra <ashnamehrotra@gmail.com> Signed-off-by: Miaha <143584635+MiahaCybersec@users.noreply.github.com>
Co-authored-by: Ashna Mehrotra <ashnamehrotra@gmail.com> Signed-off-by: Miaha <143584635+MiahaCybersec@users.noreply.github.com>
BusyBox is not preinstalled on Fedora, but it is available in the Fedora repos. However, BusyBox is not available in the RHEL or Rocky repos. |
Simplify the detection of installed package managers and required tools by using `strings.Contains` instead of splitting the applications list. This change reduces nested loops and enhances code readability while maintaining functionality for checking missing tools and package managers. Signed-off-by: Miaha Cybersec <MiahaCybersec@gmail.com>
Only failing check is codecov/project - presumably a similar case to #706 |
Closes #651, #652