Skip to content
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

Registration - use registration_url for RHSM configuration #10370

Closed
wants to merge 1 commit into from

Conversation

stejskalleos
Copy link
Contributor

What are the changes introduced in this pull request?

Follow up to #10315, if Smart Proxy Registration module
is configured to load balancing (registration_url is set),
use this value for RHSM configuration when registering host, see global registration

Considerations taken when implementing this change?

What are the testing steps for this pull request?

  • Configure smart proxy to load balancing
  • Register host
  • Check that correct RHSM URLs are set and it works

@theforeman-bot
Copy link

Issues: #35811

@stejskalleos
Copy link
Contributor Author

@ehelms

@stejskalleos stejskalleos marked this pull request as ready for review December 1, 2022 09:00
@ehelms
Copy link
Member

ehelms commented Dec 1, 2022

Seems pretty straight forward and would solve the problem to me. @ekohl / @evgeni since we discussed this amongst ourselves, I'd like your thoughts.

Copy link
Member

@ekohl ekohl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not doing what you think it's doing. You're changing a dead code path and won't work without changes to the installer to STOP setting the rhsm_url.

Then comes the point: when do you set rhsm_url and when don't you. I'd say this leads to more problems than it solves so 👎 from my point of view.

Comment on lines 465 to +468
elsif pulp_primary?
URI("https://#{URI.parse(url).host}/rhsm")
URI("https://#{URI.parse(proxy_url).host}/rhsm")
elsif pulp_mirror?
URI("https://#{URI.parse(url).host}:8443/rhsm")
URI("https://#{URI.parse(proxy_url).host}:8443/rhsm")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These code paths should be unused since Foreman 3.1.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I grok from that only the initial if statement is ever triggered now, and is really not needed anymore. That, with this idea this function could be shortened to:

def rhsm_url

    url = setting('Registration', 'registration_url') || setting(SmartProxy::PULP3_FEATURE, 'rhsm_url')
    URI(url)

end

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct that only the initial if is triggered. Still, big 👎 from my side on this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ekohl so what would be the proper fix / update?

@ehelms
Copy link
Member

ehelms commented Dec 12, 2022

Then comes the point: when do you set rhsm_url and when don't you. I'd say this leads to more problems than it solves so from my point of view.

Can you expand on this? Sounds like the devil is in the details, but we need the details to understand why this won't work.

@ekohl
Copy link
Member

ekohl commented Dec 12, 2022

The short answer is that we have a mechanism to declare what the RHSM URL is. I think we should really use that end-to-end. This PR effectively gets rid of the mechanism, which I think is a step back. It's something we should solve in our configuration layer (Puppet/installer in this case), not on the application layer. There we already have a registration URL setting - we could derive the value there and put it statically in the right Smart Proxy's YAML file.

@ehelms
Copy link
Member

ehelms commented Dec 12, 2022

We discussed this a bit today -- this solution only covers half the use case and has the potential to leave some functional gaps (e.g. changing the content source). We are instead, considering this simpler approach:

theforeman/puppet-foreman_proxy_content#432

@stejskalleos
Copy link
Contributor Author

Okay then, I'm closing the PR and let's continue in theforeman/puppet-foreman_proxy_content#432

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants