-
Notifications
You must be signed in to change notification settings - Fork 218
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
Patch of resource fails due to 'the server rejected our request due to an error in our request' #2759
Comments
Hi @tomdw , could you pls create a simple reproducer, we did not see this before, and the finalizer removal is covered in quite a lot of tests. So would be good to see the details. |
I randomly got the same error and stacktrace when patching the CR status in a regular reconciliation loop (no resource clean-up call), but only when SSA is disabled for patching the primary resource. .withUseSSAToPatchPrimaryResource(false)
.withSSABasedCreateUpdateMatchForDependentResources(true) Will try to provide you with a reproducer |
Thx, just a note we don't do anything special there, just calling the client that calls the API. Note that a common issues is when you mix ssa patch with non ssa patch on resources, make sure you settle on one or the other. |
mmm, right, then why not just keep one single entry point/method to configure SSA? Otherwise having two |
We wanted to be backwards compatible in this case. Also not that patching the primary resource is part of the low level API, and DependentResources is something that you might use or not. Also there is difference between managing patching primary and some other resource, those does not effect each other. So this level of granularity seems to right for me. |
Ahh sorry, misunderstanding, this is how I mean it: if you mix that on same resource. Thus had a resource managed before without SSA and you switch manage to SSA of that same resource. |
Understood. Thanks for clarifying @csviri. .withUseSSAToPatchPrimaryResource(false)
.withSSABasedCreateUpdateMatchForDependentResources(true) Stacktrace in my case is slight different since for me this is not happening when cleaning-up a resource but in a regular reconciliation loop. |
Bug Report
What did you do?
Written a reconciler for a Kubernetes resource which patches the resource during cleanup (probably to remove the finalizer).
What did you expect to see?
Succesfull patch of the resource without any ERROR log
What did you see instead? Under which circumstances?
The Patch logs an ERROR due to a 'the server rejected our request due to an error in our request' error from kubernetes, but t the same time the cleanup continues and seems to remove the resource. If it succeeds I do not expect an ERROR log.
Environment
Kubernetes cluster type:
vanilla
$ Mention java-operator-sdk version from pom.xml file
5.0.4
$ java -version
21
$ kubectl version
1.30.7
Possible Solution
Might be related to which kind of patch is used? See https://stackoverflow.com/questions/57480205/error-while-applying-json-patch-to-kubernetes-custom-resource where a similar problem is described and a merge patch is to be used to avoid such a thing?
Additional context
N/A
The text was updated successfully, but these errors were encountered: