-
Sub-task
-
Resolution: Done
-
Undefined
-
None
-
None
-
0
-
False
-
-
False
-
0
-
Phoenix - Content
-
-
-
Sprint 133, Sprint 134, Sprint 135, Sprint 136, Sprint 137, Sprint 138, Sprint 139, Sprint 140, Sprint 141
Description of problem:
Continuing from https://bugzilla.redhat.com/show_bug.cgi?id=2277130 , If we look at the unregistered host from UI as well as the database, It will still have a Kickstart repository ID associated.
Now, due to the lack of CV and LCE associations, When someone tries to directly just rebuild that stale entry, The kickstart template will be generated just with the BaseOS kickstart repo and will miss the Appstream repo, leading to failures during provisioning process.
Version-Release number of selected component (if applicable):
Red Hat Satellite 6.14.3 [ with https://github.com/Katello/katello/pull/10797/files applied ]
Red Hat Satellite 6.15.0
How reproducible:
Always
Steps to Reproduce:
Exact same as https://bugzilla.redhat.com/show_bug.cgi?id=2277130
Actual results:
Same as https://bugzilla.redhat.com/show_bug.cgi?id=2277130
Additionally, if we look at the content_facet of the host, It will still have kickstart repository ID associated.
Before:
irb(main):022:0> pp h.content_facet
#<Katello::Host::ContentFacet:0x000055d6e788d920
id: 21,
host_id: 28,
uuid: "8d81043f-a295-4ba3-8ed1-37e1b50b20ea",
kickstart_repository_id: 278,
content_source_id: 1,
installable_security_errata_count: 0,
installable_enhancement_errata_count: 0,
installable_bugfix_errata_count: 0,
applicable_rpm_count: 16,
upgradable_rpm_count: 0,
applicable_module_stream_count: 0,
upgradable_module_stream_count: 0,
applicable_deb_count: 0,
upgradable_deb_count: 0>
After:
irb(main):004:0> pp h.content_facet
#<Katello::Host::ContentFacet:0x0000559762f3e900
id: 21,
host_id: 28,
uuid: nil,
kickstart_repository_id: 278,
content_source_id: 1,
installable_security_errata_count: 0,
installable_enhancement_errata_count: 0,
installable_bugfix_errata_count: 0,
applicable_rpm_count: 16,
upgradable_rpm_count: 0,
applicable_module_stream_count: 0,
upgradable_module_stream_count: 0,
applicable_deb_count: 0,
upgradable_deb_count: 0>
The same would be visible in UI , when editing the host.
If we put the Host in Build mode, satellite allows doing so and just with the BaseOS kickstart repo URL which eventually leads to failed kickstart deployment, due to missing packages [ i.e. missing appstream kickstart repo ].
Expected results:
When registering a host, The kickstart_repository association should be removed from the host as well.
So that when a user mistakenly tries to rebuild the host, It would show some sort of error with template rendering thus forcing the user to edit the host and select all relevant values and the save them, before retrying the build action.
Additional info:
If i combine https://github.com/Katello/katello/pull/10797/files with host.content_facet.kickstart_repository = nil i.e.
- git diff
diff --git a/app/services/katello/registration_manager.rb b/app/services/katello/registration_manager.rb
index e3add5b..9f93757 100644-
- a/app/services/katello/registration_manager.rb
+++ b/app/services/katello/registration_manager.rb
@@ -316,6 +316,8 @@ module Katello
host.content_facet.applicable_errata = []
host.content_facet.uuid = nil
host.content_facet.content_view_environments = []
+ host.content_facet.content_source = ::SmartProxy.pulp_primary
+ host.content_facet.kickstart_repository = nil
host.content_facet.save!
Rails.logger.debug "remove_host_artifacts: marking CVEs unchanged to prevent backend update"
host.content_facet.mark_cves_unchanged
- a/app/services/katello/registration_manager.rb
-
It does the job at database level and also does not allow putting the host in build mode.
But if I edit the host, And go to OS tab, I can still see the repository there. So I guess some additional UI level fix would be needed to maintain consistency.
Please check the support case 03796000 and the discussion on the same for additional information
DEV Tracker for https://issues.redhat.com/browse/SAT-24787
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2277133