Repository navigation
feat(rhcconf): write rhc.conf configuration to rhsm.conf - #627
Conversation
63703ed to
780e453
Compare
780e453 to
c070790
Compare
pkoprda
left a comment
There was a problem hiding this comment.
Thanks @stephenbourke, I left some comments below.
Also please add Signed-off-by: at the end of your commit description.
64a6824 to
b2826ba
Compare
|
Looked into the test_features_enable_writes_satellite_registration_target failure (DuplicateSectionError: section 'rhsm' already exists, rhsm.conf line 38). Suggested fix on our side: use a single SetAll instead of four Set calls , one in-memory update, one persist, no intermediate events to race against. The subman Set() docstring recommends exactly this. |
1cdf8ac to
03cd5a0
Compare
b8ed730
03cd5a0 to
b8ed730
Compare
mjcr99
left a comment
There was a problem hiding this comment.
Thanks @stephenbourke! I think I've spotted a couple of worth to do checks.
b8ed730 to
92c1efc
Compare
* Card ID: CCT-3023 - Write only the registration target, content base URL, and proxy keys that rhc.conf sets explicitly into rhsm.conf, through com.redhat.RHSM1.Config.SetAll. SetAll applies every key in a single call so a failure cannot leave rhsm.conf with only some keys written. Commented keys and embedded defaults are omitted, so the packaged rhc.conf leaves rhsm.conf unchanged. api.insights and http.timeout are not translated. api.rpm-content tls-verify and ca-path are not written: server.insecure and rhsm.repo_ca_cert already come from api.subscriptions. - Map api.subscriptions.uri to server.hostname, server.port, and server.prefix, and ca-path to rhsm.repo_ca_cert, except ca-path "system", which selects the system trust store and is not a certificate file. For an explicit ca-path, validate the file exists and is readable before writing, and also set rhsm.ca_cert_dir to its directory so subscription-manager trusts the CA when it opens the registration connection, not only when dnf later reads repo files. Invert tls-verify into server.insecure. Map an explicit api.rpm-content.url to rhsm.baseurl as a whole http or https URI. Map http.proxy uri, user, password, and no-proxy to the matching server.proxy_* and server.no_proxy settings. Reject a subscriptions URI that is not https://host[:port]/prefix, a missing or unreadable ca-path, and an RPM content URI that is not an absolute http or https URI, before any Config.SetAll or Register call. - Apply the translation on rhc connect before registration, and on rhc configure features enable when the system is not registered. A write error stops before Register. Enabling a feature on an already registered system does not rewrite the registration target. - Added integration tests to test writing rhc.conf keys to rhsm.conf Signed-off-by: Stephen Bourke <sbourke@redhat.com>
92c1efc to
57f317a
Compare
Uh oh!
There was an error while loading. Please reload this page.