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

[WIP] chore(client): Simplify automatic configuration logic #4376

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

m-horky
Copy link
Contributor

@m-horky m-horky commented Mar 6, 2025

All Pull Requests:

Check all that apply:

  • Have you followed the guidelines in our Contributing document, including the instructions about commit messages?
  • No Sensitive Data in this change?
  • Is this PR to correct an issue?
  • Is this PR an enhancement?

Complete Description of Additions/Changes:

  • Card ID: CCT-1176

Historically, insights-client has been using so-called legacy API at cert-api.access.redhat.com. The configuration object contains key legacy_upload which is True for most of them.

Non-legacy API has existed for years now at cert.cloud.redhat.com (or newer cert.console.redhat.com). Both legacy and non-legacy contain the same services on them, but the domain name and base path differ, along with minor differences in behavior, both server- and client-side.

This patch updates the autoconfig logic to separate out individual responsibilities (making them testable) and exposes the legacy/nonlegacy logic, which is determined by the content of /etc/rhsm/rhsm.conf and /etc/insights-client/insights-client.conf.

Instead of rewriting the base_url value several times, it tries to keep the logic separated from the action where the new configuration options are applied.

@m-horky m-horky force-pushed the mhorky/el10-cloud-rh-c branch 3 times, most recently from 701fbfe to f84f6a9 Compare March 6, 2025 12:58
* Card ID: CCT-1176

Historically, insights-client has been using so-called legacy API at
cert-api.access.redhat.com. The configuration object contains key
legacy_upload which is True for most of them.

Non-legacy API has existed for years now at cert.cloud.redhat.com (or
newer cert.console.redhat.com). Both legacy and non-legacy contain the
same services on them, but the domain name and base path differ, along
with minor differences in behavior, both server- and client-side.

This patch updates the autoconfig logic to separate out individual
responsibilities (making them testable) and exposes the legacy/nonlegacy
logic, which is determined by the content of /etc/rhsm/rhsm.conf and
/etc/insights-client/insights-client.conf.

Instead of rewriting the base_url value several times, it tries to keep
the logic separated from the action where the new configuration options
are applied.

Signed-off-by: mhorky <[email protected]>
@m-horky m-horky force-pushed the mhorky/el10-cloud-rh-c branch from f84f6a9 to 85be856 Compare March 6, 2025 15:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant