[ci_gen_kustomize_values] Fix non-deterministic snippet combine order - #4138
[ci_gen_kustomize_values] Fix non-deterministic snippet combine order#4138imatza-rh wants to merge 1 commit into
Conversation
generate_values.yml combines per-stage YAML snippets (base template defaults, base64 patches, user-provided overrides) via a loop over ansible.builtin.find results. Snippet filenames use a numeric prefix (02_ci_data.yaml, 03_user_data_b64.yaml, 04_user_data.yaml) to signal intended override precedence, but find() does not guarantee sorted results, so combine order (and therefore which snippet wins on conflicting keys) was filesystem-order dependent instead of matching the intended numeric precedence. Observed on RHOSO 19 RHEL 10 uni01alpha (OSPNW-1694): a user-provided edpm_fips_mode: check override (needed because fips-mode-setup was removed from RHEL 10) was silently discarded in favor of the common edpm-nodeset-values template's cifmw_fips_enabled-derived default of 'enabled', causing every EDPM bootstrap job to fail with 'fips-mode-setup: No such file or directory'. Confirmed live on the held CI node: the OpenStackDataPlaneNodeSet spec carried edpm_fips_mode: enabled despite the override, and patching it to 'check' on the same live NodeSet let the bootstrap job complete cleanly (all FIPS tasks correctly skipped). Add an explicit sort(attribute='source') on the combine loop so snippets are always applied in filename order, matching the numeric prefix convention already in use. Related-Issue: #OSPNW-1694 Related-Issue: #OSPNW-1715 Signed-off-by: Itay Matza <imatza@redhat.com>
|
[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 QodoFix deterministic YAML snippet precedence in ci_gen_kustomize_values
AI Description
Diagram
High-Level Assessment
Files changed (1)
|
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 hide the parts of a finding you never read, like the evidence or the agent prompt |
|
Build failed (check pipeline). Post ✔️ openstack-k8s-operators-content-provider SUCCESS in 3h 53m 46s |
|
recheck |
Summary
generate_values.ymlcombines per-stage YAML snippets via a loop overansible.builtin.findresults. Snippet filenames use a numeric prefix (02_ci_data.yaml,03_user_data_b64.yaml,04_user_data.yaml) to signal intended override precedence, butfind()does not guarantee sorted results, so combine order was filesystem-order dependent instead of matching the intended numeric precedence.Impact observed
On RHOSO 19 RHEL 10 uni01alpha (OSPNW-1694), a user-provided
edpm_fips_mode: checkoverride (needed becausefips-mode-setupwas removed from RHEL 10) was silently discarded in favor of the commonedpm-nodeset-valuestemplate'scifmw_fips_enabled-derived default ofenabled, causing every EDPM bootstrap job to fail withfips-mode-setup: No such file or directory.Live verification: on the held CI node from tp !2601 build b5e8409, the
OpenStackDataPlaneNodeSetspec carriededpm_fips_mode: enableddespite the job-var override. Patching it tocheckdirectly on the live NodeSet and re-running thebootstrapservice completed cleanly (all FIPS tasks correctly skipped,failed=0).Fix
Add an explicit
sort(attribute='source')on the combine loop so snippets are always applied in filename order, matching the numeric prefix convention already in use.Related-Issue: #OSPNW-1694
Related-Issue: #OSPNW-1715