-
Notifications
You must be signed in to change notification settings - Fork 287
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 #15818 - Show which capsule a host is registered through #6211
Fixes #15818 - Show which capsule a host is registered through #6211
Conversation
Testing should be done on both a dev env and a production instance as HTTP headers vary in production mode. |
50bf9bc
to
5ef8477
Compare
All seems to be working correctly in production from my testing |
@@ -198,6 +198,9 @@ def consumer_create | |||
sync_task(::Actions::Katello::Host::Register, host, System.new, rhsm_params, content_view_environment) | |||
host.reload | |||
|
|||
parent_host = get_parent_host(request.headers) | |||
host.subscription_facet.update_attribute(:registered_through, parent_host) | |||
|
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.
this likely needs to be done via consumer_activate too, and I'd suggest doing it on facts (and possibly upload_package_profile too), so that if the client changes what capsule its using it'll automatically update
5ef8477
to
adfb436
Compare
@jlsherrill updated with your suggestions |
[test] |
1 similar comment
[test] |
|
hostnames = headers["HTTP_X_FORWARDED_SERVER"] | ||
host = hostnames.split(",")[0] if hostnames | ||
host || Facter.value(:fqdn) || SETTINGS[:fqdn] | ||
end |
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.
Mind writing a test for this function? I think you can likely call it directly on the @controller
variable from a controller test file
Mind making this searchable? |
@jlsherrill is this not working? |
@johnpmitsch still in the process of testing it. Seems good so far. Why do you ask? |
@@ -25,6 +25,7 @@ module SubscriptionFacetHostExtensions | |||
scoped_search :on => :autoheal, :in => :subscription_facet, :complete_value => true | |||
scoped_search :on => :service_level, :in => :subscription_facet, :complete_value => true | |||
scoped_search :on => :last_checkin, :in => :subscription_facet, :complete_value => true | |||
scoped_search :on => :registered_through, :in => :subscription_facet, :complete_value => true |
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.
ohhh this!
ignore me :)
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.
😄
ACK pending testing that function |
This displays the system that a host is registered through in a 'registered_through' field that is searchable and displayed in the content host details page. If the host is registered to the main katello server, the field will display that.
adfb436
to
8597c85
Compare
@jlsherrill updated with a test for |
@jlsherrill and moved |
ACK 👍 |
This displays the system that a host is registered through in a
'registered_through' field that is searchable and displayed in the
content host details page. If the host is registered to the main
katello server, the field will display that.