-
Notifications
You must be signed in to change notification settings - Fork 290
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
Fixes #37831 - Don't filter job template install content by bound repos #11150
Fixes #37831 - Don't filter job template install content by bound repos #11150
Conversation
I'm waiting to see if I need to update any tests. |
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.
Remove uses Katello::InstalledPackage, but that list would still be out of date if the package profile is out of date. Can we update this for remove as well?
@@ -538,7 +538,7 @@ def yum_names_for_job_template(action:, search:, versions: nil) | |||
if pkg_name_archs.empty? |
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.
The line above this still searches the host's installed_packages
, and then errors if an installed package is not found. Doesn't this need updating as well?
The host installed package list being out of date is a different problem from the host bound repository list being out of date in my mind. I'm mentioning this because, if we want to send the raw package list for updates / removals rather than a list of found packages, we'll need to stop using the search query entirely. If somehow the host has packages installed that are not known to Katello, they may not be in our database at all. In fact, at that point, wouldn't they not show up in the UI anyway? |
I think the best I could do to make a removal / update error less likely would be to have the search look at all of |
What I was thinking about is this: The new Packages wizard uses
And in select all mode, it will be
For the select all mode case, we can't really know what the user intent was, so we'd have to error. But in the regular mode case (which should be the majority of jobs) we could simply parse and use the literal list cc @parthaa |
Can't this search query be anything, even wildcard matching like Is the idea that if we detect the query string looks like full package names then we pass them to dnf directly, otherwise we treat it as a query string? |
Yeah I mean it's not perfect for sure, but in regular (not select all) mode So it relies on that mostly. |
It feels a little bit fragile, especially if the format of the query string ever changes. I think we need a third opinion, @parthaa ? :) |
It could also be done without parsing the query string; it'd just be a bit more work because you'd have to have the frontend send the explicit package names over cleanly. (But again, it would only work in normal mode and not select-all mode, and only when You're right that simply looking at all available packages is much cleaner. I was just hoping there was a way to avoid erroring altogether and let dnf/yum handle package availability. If you can think of any others I'm open! Otherwise I'm fine going with your approach. |
I thought a bit and I think continuing to use the search query as an actual search query would be less risky for the quick turnaround that this PR needs to have. I'm going to improve the chances of finding a package on update/remove by searching for all ::Katello::InstalledPackages rather than limiting the search to those packages associated with the host in question. I agree that the best long-term solution would be to change the template to not even use a search query and to send the package info directly to DNF, maybe we could do a further redesign when there's more time. |
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.
Let's get this in for now, it's better than what we've got. Ack pending finishing of your testing. 👍
4fbfc32
to
ab5949a
Compare
I found an issue with this strategy with how upgrades work -- the full nvra is used for updates rather than just the package name. So, if I don't filter installed packages by host, updating a package on a RHEL 8 host might use the full nvra from a RHEL 10 version of the same package. |
I think an eventual solution could look like
we could also do something similar for errata. |
ab5949a
to
2168929
Compare
I managed to find a solution that works in my testing. I've pushed the changes. |
Tested:
|
What are the changes introduced in this pull request?
Stops RPM, Deb, and Errata installation jobs from limiting content searches to what Katello thinks is applicable to a host. If a user made changes to reposets, the applicability data could be out of date. This change lets
dnf
rather than Katello be the final determination of whether or not some content is installable.There's a bonus too -- if the dnf run completes, the package profile will get uploaded, which will in turn update applicability.
Considerations taken when implementing this change?
I couldn't think of any reason why Katello needs to block content installation attempts when
dnf
can do it itself.I considered just updating the error message to tell the user that the package profile may need updating. However, I think it's a bit of a technical thing to have users worry about.
What are the testing steps for this pull request?
-> We want the package profile to be stale so that packages are installable but Katello doesn't know that
dnf
will be the one to report any issues).