Actions
Bug #39257
closedHosts end up with a nil content source when registered to a foremanctl setup
Description
When registering a host, Katello finds and sets the content source id. This is done via a method:
def get_content_source_id(hostname)
proxies = SmartProxy.unscoped.authorized.filter do |sp|
hostname == URI.parse(sp.url).hostname
end
return nil if proxies.length != 1
proxies.first.id
end
Actual behavior
Problem is that in foremanctl setups,
[26] pry(main)> proxies = SmartProxy.unscoped.authorized.filter do |sp| hostname == URI.parse(sp.url).hostname end.map(&:name) => ["satellite.example.com-pulp", "satellite.example.com-dev"]
there are two or more valid Smart Proxies whose hostname matches, causing
return nil if proxies.length != 1
to leave the host with a nil content source.
Expected behavior
We need to adjust this check to < 1.
Additionally, the -pulp and -dev smart proxies may have different hostnames. For this and other reasons, we should not rely on the name or hostname to find the correct smart proxy. Rather, we should use SmartProxy.with_feature('pulp')
Updated by The Foreman Bot 3 months ago
- Status changed from New to Ready For Testing
- Assignee set to Jeremy Lenz
- Pull request https://github.com/Katello/katello/pull/11716 added
Updated by Jeremy Lenz 3 months ago
- Status changed from Ready For Testing to Closed
Applied in changeset katello|489b34f42e42389f861cfdc0faa4ede1199cb180.
Updated by Ian Ballou 2 months ago
- Target version set to Katello 4.21.0
- Triaged changed from No to Yes
Actions