-
Bug
-
Resolution: Done-Errata
-
None
-
6.14.0
-
0
-
False
-
-
False
-
CLOSED
-
0
-
Endeavour
-
-
-
No
+++ This bug was initially created as a clone of Bug #2266432 +++
Description of problem:
Nested inheritance of hostgroup is not honored in Red Hat Satellite 6
Version-Release number of selected component (if applicable):
6.14
How reproducible:
Consider the below scenario:
hostgroup HG1 is created with some params of LCE CV Content Soruce etc, now I create a nested hostgroup HG1/HG2 from it and change a param. thereafter I create another nested HG1/HG2/HG3 and the initial params for this hostgroup are of hostgroup HG1 and not HG1/HG2.
Expected results:
Ideally HG1/HG2/HG3 should by default have what HG1/HG2 has.
Additional info:
Workaround is to manually change the params.
— Additional comment from on 2024-02-28T13:56:42Z
The problem is quite noticeable i.e. happens exactly as it is reported and I might have found why as well.
- rpm -q satellite katello foreman
satellite-6.14.2-1.el8sat.noarch
katello-4.9.0-1.el8sat.noarch
foreman-3.7.0.11-2.el8sat.noarch
- grep ancestry /usr/share/gems/gems/katello-4.9.0.21/app/models/katello/concerns/hostgroup_extensions.rb -A3 -B3 | tail
- given we are querying hg1111 (the leaf), and a value is set on:
- hg1: 1
– - it will return the value 2.
facet_model = Facets.registered_facets[facet].hostgroup_configuration.model
value = facet_model.where.not(attribute => nil).joins(:hostgroup).merge(
::Hostgroup.where(id: self.ancestor_ids).reorder(ancestry: :desc)
).limit(1).pluck(attribute).first
end
value
First Let me tell you what my reproducer is i.e. The order of inheritenace is this:
HG1 -> HG2 --> HG3
Where, no matter what i tweak in HG2 ( CV or LCE ), HG3 always picks up the LCE or CV values from HG1.
Now, I believe it's because of the way we check the ancestry here.
::Hostgroup.where(id: self.ancestor_ids).reorder(ancestry: :desc)
).limit(1).pluck(attribute).first
in rake console when i do this i.e.
hg = Hostgroup.find_by_name('HG3')
hg.ancestors.pluck(:id,:name)
=> [[6, "HG1"], [7, "HG2"]]
pp hg.ancestors.reorder(ancestry: :desc).limit(1)
[#<Hostgroup:0x00005579454182a0
id: 6,
name: "HG1",
created_at: Wed, 28 Feb 2024 12:52:13.694389000 UTC +00:00,
updated_at: Wed, 28 Feb 2024 12:52:13.694389000 UTC +00:00,
operatingsystem_id: nil,
architecture_id: nil,
medium_id: nil,
ptable_id: nil,
root_pass: nil,
puppet_ca_proxy_id: nil,
use_image: nil,
image_file: nil,
ancestry: nil,
vm_defaults: nil,
subnet_id: nil,
domain_id: nil,
puppet_proxy_id: nil,
title: "HG1",
realm_id: nil,
compute_profile_id: nil,
grub_pass: nil,
lookup_value_matcher: "[FILTERED]",
openscap_proxy_id: nil,
subnet6_id: nil,
pxe_loader: nil,
description: "",
compute_resource_id: nil>]
And this seems to be pointing to wrong ancestry here i.e. HG3 gets HG1 as it's ancestor.
But perhaps i am completely wrong here.
Anyways, if i am right, then maybe upstream already has a fix i.e. https://github.com/Katello/katello/pull/10841/files ??
— Additional comment from on 2024-02-28T14:13:38Z
Maybe https://github.com/Katello/katello/pull/10841#issuecomment-1936567351 already fixes the issue ?
— Additional comment from on 2024-03-04T13:08:55Z
Hey Quinn, Ian, can you confirm if the linked PR fixes this issue as well? thanks
— Additional comment from on 2024-03-04T14:59:57Z
I believe the one Sayan pointed https://github.com/Katello/katello/pull/10841/files + https://github.com/Katello/katello/pull/10903 should resolve this issue
— Additional comment from on 2024-03-04T15:57:06Z
Connecting redmine issue https://projects.theforeman.org/issues/36897 from this bug
— Additional comment from on 2024-03-04T15:57:27Z
Connecting redmine issue https://projects.theforeman.org/issues/37197 from this bug
— Additional comment from on 2024-03-06T20:03:41Z
Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/36897 has been resolved.
— Additional comment from on 2024-03-27T14:15:04Z
-
-
- Bug 2260473 has been marked as a duplicate of this bug. ***
-
— Additional comment from on 2024-04-12T20:12:40Z
Hi Team,
Updating below information as updated on duplicate closed bug # https://bugzilla.redhat.com/show_bug.cgi?id=2260473
I can see similar issue on Satellite 6.14 without nested hostgroup:
~~~
If I am using a newly created hostgroup without nesting I can reproduce the same.
However, if I try to create a host and selecting the same hostgroup while provisioning, the hostgroup populating correct details for synced content.
~~~
Thanks & Regards,
Mohit Kushwah
- external trackers
- links to
-
RHBA-2024:132897 Satellite 6.15.1 Async Update