Bug 2065027

Summary: Job invocation installs all the installable errata if incorrect `Job Template` is used.
Product: Red Hat Satellite Reporter: Akhil Jha <akjha>
Component: Remote ExecutionAssignee: Adam Ruzicka <aruzicka>
Status: CLOSED ERRATA QA Contact: Akhil Jha <akjha>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.11.0CC: aruzicka, lstejska
Target Milestone: 6.11.0Keywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: tfm-rubygem-katello-4.3.0.15-1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-07-05 14:34:49 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Akhil Jha 2022-03-17 07:05:07 UTC
Description of problem:
Job invocation installs all the installable errata if incorrect `Job Template` is used.

Version-Release number of selected component (if applicable):
Satellite 7.0.0-13.0 RHEL7,RHEL8

How reproducible:
Always

Steps to Reproduce:
1. Sync repos with errata, create lce,cv(promote it),ak
2. Register host and install some packages so that errata is created. (I used 5 errata)
3. Monitor > Jobs > Run Job > Job Category = Katello > Job template = Install errata by search query - Katello SSH Default > Search Query = <registered host> > Errata search query = errataID_1,errataID_2,errataID_3 > Submit
4. You should get a success. Goto Preview templates of the job ran and toggle the job ran.
	

Actual results:
Under "#Action"(from step 4), you can see `yum -y update-minimal`. That means all the errata have been installed. But only 3 errata were supposed to be installed.

Expected results:
It should have been `yum -y update-minimal --advisory=errataID_1 --advisory=errataID_2 --advisory=errataID_3` so that only the mentioned errata is installed.

Additional info:
Yes, When using `Install errata by search query - Katello SSH Default` to install errata, you're supposed to use it as `id ^ (errataID...)` but incase the customer does not notice it, this step will install all the installable errata for that host(s). Which they might not want.

Adding a searchquery format checker or just let job should fail?

Comment 1 Adam Ruzicka 2022-03-17 10:56:42 UTC
What are the expectations? Agreed that in this case the job shouldn't do anything, but should it be marked as a success or as failure?

> Adding a searchquery format checker

I'm afraid we can't really do that in a sensible way.

Comment 2 Akhil Jha 2022-03-17 11:33:56 UTC
Marking it as a failure would be correct here(and easier for you too). If the customer wants to use comma separated errataID, they should use `Install errata - Katello SSH Default` template.

Comment 4 Bryan Kearney 2022-03-29 16:05:12 UTC
Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/34638 has been resolved.

Comment 7 Akhil Jha 2022-04-18 07:00:09 UTC
Verified
Satellite 6.11.0-16.0

Comment 10 errata-xmlrpc 2022-07-05 14:34:49 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: Satellite 6.11 Release), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2022:5498