Skip to content

[release-1.10] fix: honor init container order in spec.deployment.patch [RHDHBUGS-2900]#2865

Merged
rm3l merged 10 commits into
redhat-developer:release-1.10from
openshift-cherrypick-robot:cherry-pick-2824-to-release-1.10
May 19, 2026
Merged

[release-1.10] fix: honor init container order in spec.deployment.patch [RHDHBUGS-2900]#2865
rm3l merged 10 commits into
redhat-developer:release-1.10from
openshift-cherrypick-robot:cherry-pick-2824-to-release-1.10

Conversation

@openshift-cherrypick-robot
Copy link
Copy Markdown

This is an automated cherry-pick of #2824

/assign rm3l

rm3l and others added 10 commits May 19, 2026 14:46
Use ListIncreaseDirection: MergeOptionsListPrepend so user-specified
init containers are prepended rather than appended, allowing them to
run before install-dynamic-plugins.

Assisted-by: Claude
…GS-2900]

Add TestInitContainerOrderInSpecDeployment to verify user-specified init
containers are prepended before install-dynamic-plugins. Update existing
TestMergeFromSpecDeployment assertions to match prepend behavior. Document
list ordering semantics in docs/configuration.md.

Assisted-by: Claude
…S-2900]

Show how to place a custom init container after install-dynamic-plugins
by referencing the existing container by name first in the patch.

Assisted-by: Claude
…BUGS-2900]

Cover both ordering directions in TestInitContainerOrderInSpecDeployment:
prepending before and anchoring after install-dynamic-plugins.

Assisted-by: Claude
…HDHBUGS-2900]

kyaml's merge2 silently ignores $patch directives (e.g. $patch: replace)
when ListIncreaseDirection is set to ListPrepend. Work around this by
doing a second merge pass with default options to apply $patch directives,
after the first pass has already established correct list item positions.

Assisted-by: Claude
… [RHDHBUGS-2900]

Recommend listing all init containers explicitly in the desired order,
and note that $setElementOrder is not supported by the kyaml library.

Co-authored-by: Gennady Azarenkov <gazarenkov@gmail.com>
Assisted-by: Claude
…BUGS-2900]

Introduce rhdh.redhat.com/deployment-patch-list-merge-mode annotation
to control list merge behavior in spec.deployment.patch. Default behavior
(append) is preserved; setting the annotation to "prepend" enables
ListPrepend with a two-pass merge workaround for $patch directives.

Co-authored-by: Gennady Azarenkov <gazarenkov@gmail.com>
Assisted-by: Claude
…retainKeys) [RHDHBUGS-2900]

Assisted-by: Claude
@sonarqubecloud
Copy link
Copy Markdown

@openshift-ci openshift-ci Bot added the lgtm label May 19, 2026
@rm3l rm3l merged commit 1564635 into redhat-developer:release-1.10 May 19, 2026
8 of 9 checks passed
@codecov
Copy link
Copy Markdown

codecov Bot commented May 19, 2026

Codecov Report

❌ Patch coverage is 63.63636% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 61.05%. Comparing base (52ebcf6) to head (dc23f1a).
⚠️ Report is 3 commits behind head on release-1.10.

Files with missing lines Patch % Lines
pkg/model/deployment.go 63.63% 3 Missing and 1 partial ⚠️
Additional details and impacted files

Impacted file tree graph

@@               Coverage Diff                @@
##           release-1.10    #2865      +/-   ##
================================================
- Coverage         61.18%   61.05%   -0.14%     
================================================
  Files                37       37              
  Lines              2128     2108      -20     
================================================
- Hits               1302     1287      -15     
+ Misses              692      686       -6     
- Partials            134      135       +1     
Flag Coverage Δ
nightly ?
unittests 61.05% <63.63%> (-0.14%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
pkg/model/deployment.go 80.39% <63.63%> (-0.84%) ⬇️

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants