Fixes #38724 - Handle /consumers/ path in manifest apiUrl #11491
+13
−4
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What are the changes introduced in this pull request?
Katello provides 3 ways to give a url to contact Hosted Candlepin, in order:
We can see the format of the expected URL by looking at the hard-coded ones:
In Glue::Provider:
API_URL = 'https://subscription.rhsm.redhat.com/subscription/consumers/'.freeze
But in Katello::Resources::Candlepin::UpstreamJob it doesn't append '/consumers/':
API_URL = 'https://subscription.rhsm.redhat.com/subscription'.freeze
The result is that if the upstream consumer in your manifest has an apiUrl that appends the '/consumers/' path, calls from Glue::Provider will succeed but calls to UpstreamJob will fail. But if your manifest does NOT append the '/consumers/' path, calls from Glue::Provider will fail and calls to UpstreamJob will succeed.
Katello needs to handle adding or subtracting the '/consumers/' as needed.
This change will allow your apiUrl to either have or not have
/consumers/
at the end, and manifest refreshes should work either way.Considerations taken when implementing this change?
What are the testing steps for this pull request?
Summary by Sourcery
Ensure Katello correctly handles apiUrl values with or without the "/consumers/" suffix by normalizing URLs in both Glue::Provider and UpstreamJob
Enhancements: