Add RHUI support for cloud instance authentication#2208
Add RHUI support for cloud instance authentication#2208brandonrc wants to merge 2 commits intoosbuild:mainfrom
Conversation
Thanks for the udpate. I was worried about where that depsolver change should land myself. |
|
I am working some changes now to see if everything builds and works in a fresh AWS E2C instance with my changes that remove this out of the images repo. |
Add RHUI bool field to repository and RepoConfig structs so that repo definitions can mark repositories as using RHUI (Red Hat Update Infrastructure) for cloud instance authentication. - Add RHUI to repository, RepoConfig, Hash(), LoadRepositoriesFromReader() - Add "org.osbuild.rhui" case to NewCurlPackageItem() for manifest generation
Pass the RHUI flag to the Python depsolve solver so it can discover SSL certificates from host RHUI repo files (/etc/pki/rhui/). The actual secrets discovery is handled by osbuild-depsolve-dnf (osbuild/osbuild#2355), not here — per osbuild#2055. - v2Repository: add RHUI field for solver request/response - reposFromRPMMD: pass RHUI=true to solver (no client-side cert resolution) - toRPMMDRepoConfig: propagate RHUI from solver response - toRPMMDPackage: set org.osbuild.rhui secrets from response repo flag - validateSubscriptionsForRepos: skip RHUI repos (they don't need RHSM subs)
56af968 to
e03b0e7
Compare
|
This PR changes the images API or behaviour causing integration failures with osbuild-composer. The next update of the images dependency in osbuild-composer will need work to adapt to these changes. This is simply a notice. It will not block this PR from being merged. |
|
Updated this PR based on @thozza's feedback about #2055. What changed: All depsolver secrets discovery logic has been moved to the Python solver in osbuild/osbuild#2355. This PR no longer modifies
Net diff is 28 insertions, 6 deletions across 4 files. The companion osbuild PR (osbuild/osbuild#2355) handles all the heavy lifting: RHUI cert discovery from Tested end-to-end on AWS EC2 RHEL 8.10 — full qcow2 compose with 469 RPMs from RHUI repos. |
e03b0e7 to
8bae706
Compare
Summary
Adds RHUI (Red Hat Update Infrastructure) support so that cloud RHEL instances can build images using RHUI repos instead of requiring RHSM subscriptions.
All secrets discovery logic (SSL cert resolution, cloud identity headers) lives in the Python depsolve solver in osbuild/osbuild#2355 — this PR only adds the data model plumbing and request/response wiring needed for the Go side to pass
rhui: trueto the solver and consume its response. No depsolver secrets discovery logic is added here, per #2055.Closes #2207
Related: osbuild/osbuild-composer#820 (original report), osbuild/osbuild#2355 (Python solver RHUI support), osbuild/osbuild-composer#5028
Changes
1.
rpmmd,osbuild: add RHUI field and curl source supportRHUI boolfield toRepoConfigandrepositorystructs inpkg/rpmmd/repository.goRHUIinRepoConfig.Hash()so RHUI repos get distinct cache keysRHUIthroughLoadRepositoriesFromReader()case "org.osbuild.rhui"toNewCurlPackageItem()inpkg/osbuild/curl_source.go2.
depsolvednf: wire RHUI flag through solver request and responseRHUI booltov2Repositoryand pass it throughreposFromRPMMD()so the Python solver can discover RHUI SSL certs from host repo filesRHUIfrom solver response repos viatoRPMMDRepoConfig()org.osbuild.rhuisecrets intoRPMMDPackage()based on the response repo's RHUI flagvalidateSubscriptionsForRepos()to skip RHUI repos (they use cloud instance identity, not RHSM entitlement certs)applyRHSMSecrets()is unchanged — it is still needed for the existing RHSM path since Go does not yet sendrhsm=trueto the solver (see TODO inreposFromRPMMD)How it works
RHUI: trueon repo configs for cloud RHEL reposrhui: truein the depsolve request toosbuild-depsolve-dnf/etc/pki/rhui/and cloud identity headers (AWS/GCP) — all in Add native RHUI support for building images on cloud instances osbuild#2355rhui: true+secrets: "org.osbuild.rhui"on resolved reposorg.osbuild.rhuion packages from those reposorg.osbuild.rhuisecrets provider to download RPMs with cloud-specific authTest plan
TestApplyRHSMSecretstests pass (function unchanged from main)Stopgap
Until this is merged, users can use osbuild-rhui-shim as a workaround.