-
Notifications
You must be signed in to change notification settings - Fork 535
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
Test and Replace patch fails but works with kubectl #2095
Comments
What message does the 422 error return? Hopefully there is some more info in there about why it doesn't like it. I would also try adding |
Ok so --v=10 is pretty verbose. I tried to redact as much as I could in this github gist. Let me know if I went to far Looking at the Node client source code I added a console error here before the Node Client begins the request:
If I stringily the error that is thrown I get:
|
So the only thing that I notice is that there is a trailing comma in your list of patches. I wouldn't think that would cause problems, but maybe? It's also sending a |
The trailing comma was added by my formatter and does not appear in the actual request parameters. I added Going to continue poking at this and see whats up |
Describe the bug
I can successfully run the following code with kubectl:
And the pods label for
A
changes to"false"
if the pod originally had the"true"
label otherwise it fails withThe request is invalid: the server rejected our request due to an error in our request
.However, following the patch example here results in the NodeJS client returning 422s for the code below.
If I remove either of the patches, it works either testing correctly or patching, but I can't seem to get both to run without a 422.
** Client Version **
0.15.0
I also tried with
0.22.3
and it also doesn't work** Server Version **
To Reproduce
See description of bug
Expected behavior
I would expect a valid combination of test + replace + add to work similar to a kubectl version of the command
** Example Code**
Code snippet for what you are doing
Environment (please complete the following information):
Additional context
I am running kind (
kind version 0.20.0
) locally instead of interacting with a cloud k8s cluster. I created it withkind create cluster --image=kindest/node:v1.27.3
The text was updated successfully, but these errors were encountered: