-
Notifications
You must be signed in to change notification settings - Fork 40.4k
Incorrect initContainers order when using server-side apply #104641
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
cc @apelisse |
Hm, IIRC we thought about this and the design had an answer for this, so there is probably just a bug somewhere. |
Here's the code, if I'm reading it correctly. We first add and merge all items in the order provided by LHS (the current, live object): And then we collect/append all remaining items from RHS (the applied object): So the code works "as intended", the intent seems very wrong though? |
/triage accepted |
/assign @apelisse |
/assign |
/reopen The modified behavior in #105983 still does not match my expectations. Hoisting from #106191 (comment): This is what happens now:
That discards the order expressed by fieldManager Also, when applying non-overlapping items, this PR changed the behavior, which makes it a hard case for backporting:
|
@liggitt: Reopened this issue. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
milestoning and upgrading priority so we ensure the behavior we ship in 1.23 is intentional |
Thanks for the counter example. Working on that. |
How about this. We add each item in LHS until hitting an item in RHS (not inclusive), then we do our current algorithm with the rest a,b,c MEREG c,d,e,f
Another example a b c g f MERGE c d e f, result = a b c d e f g |
I think reading from HEAD of LHS until we hit a shared item is a good start, but I think this should be iterative so that we preserve both LHS and RHS in non-conflicting cases, and there needs to be a pre-merge step where we identify items in LHS we can't honor the LHS order of because of RHS. I was thinking something along these lines: https://gist.github.com/liggitt/1e5f40f92235d4440724af24f803f17e |
if the updated merge is not available ~today, we should revert #105983 to make sure we don't ship 1.23 with unfinalized changes |
fyi, this is apimachinery, not node (it's an apply issue, not an initContainers issue) |
Actually, since we're in rc territory already, I opened the revert in #106660 and picked to release-1.23 in #106661. Once the updated merge is ready, we can consider backports. |
Since we already have two new candidates for the new algorithm, both of which covers all known cases, this issue should settle soon-ish once we choose one of them. |
that's fine, but at this point, this seems like a candidate for v1.23.x via normal backport |
revert merged to master, will get picked to 1.23. reset priority and milestoned as 1.24, but a fix here could be eligible for backport to release branches, including 1.23.x |
Got it. Will have the new implementation ready soon. |
What happened:
The order of
initContainers
is significant, but when usingkubectl apply --server-side
to change this field, the intended order is not preserved.What you expected to happen:
I expected the order of
initContainers
to match my submitted intent.How to reproduce it (as minimally and precisely as possible):
Files:
Create the StatefulSet and see it has one init container:
Add two more init containers, one before and one after the original. See that they are both added to the end:
Anything else we need to know?:
kubectl replace
puts them in the intended order:Environment:
Kubernetes version (use
kubectl version
):Install tools:
k3d
,brew install kubernetes-cli
/sig api-machinery
The text was updated successfully, but these errors were encountered: