[kustomize_deploy] Randomize libvirt-secret password at deploy time - #4174
[kustomize_deploy] Randomize libvirt-secret password at deploy time#4174abays wants to merge 1 commit into
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
PR Summary by QodoRandomize libvirt-secret passwords during Kustomize deployment
AI Description
Diagram
High-Level Assessment
Files changed (5)
|
Code Review by Qodo🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)
Great, no issues found!Qodo reviewed your code and found no material issues that require reviewTip of the day💡 Did you know, you can turn these tips off under Display preferences |
The architecture repo's lib/dataplane/nodeset component generates a libvirt-secret Secret from a hardcoded libvirt-secret.env file (LibvirtPassword=12345678). Extend the post-kustomize manifest injection pattern introduced for osp-secret so this well-known default password is also randomized before `oc apply`. After each `kustomize build`, if the rendered dataplane manifest contains a libvirt-secret Secret, its data keys are replaced with a cryptographically random value via the shared `osp_secret_manifest.py` helper, unless a live cluster secret already exists (in which case its value is preserved across redeploys). To support this, generalize `osp_secret_manifest.py` so its helpers and CLI commands (has, get, get-namespace, set, randomize) accept an optional secret name, defaulting to osp-secret for backward compatibility. Add a new inject_libvirt_secret_key.yml task file mirroring the osp-secret randomization block, wired into execute_step.yml so it runs for every stage but is a no-op except for the dataplane stage. Co-Authored-By: Cursor <cursoragent@cursor.com> Signed-off-by: Andrew Bays <abays@redhat.com>
1166e35 to
71c8764
Compare
|
Build failed (check pipeline). Post ✔️ openstack-k8s-operators-content-provider SUCCESS in 3h 16m 45s |
|
recheck |
|
Build succeeded (check pipeline). ✔️ openstack-k8s-operators-content-provider SUCCESS in 3h 09m 33s |
The architecture repo's lib/dataplane/nodeset component generates a libvirt-secret Secret from a hardcoded libvirt-secret.env file (LibvirtPassword=12345678). Extend the post-kustomize manifest injection pattern introduced for osp-secret so this well-known default password is also randomized before
oc apply.After each
kustomize build, if the rendered dataplane manifest contains a libvirt-secret Secret, its data keys are replaced with a cryptographically random value via the sharedosp_secret_manifest.pyhelper, unless a live cluster secret already exists (in which case its value is preserved across redeploys).To support this, generalize
osp_secret_manifest.pyso its helpers and CLI commands (has, get, get-namespace, set, randomize) accept an optional secret name, defaulting to osp-secret for backward compatibility. Add a new inject_libvirt_secret_key.yml task file mirroring the osp-secret randomization block, wired into execute_step.yml so it runs for every stage but is a no-op except for the dataplane stage.