Skip to content

BadRequest: json: cannot unmarshal object into Go value of type jsonpatch.Patch with PatchNamespacedDeployment #1186

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

Closed
bhadreshpanchal88 opened this issue Jan 23, 2023 · 3 comments

Comments

@bhadreshpanchal88
Copy link

bhadreshpanchal88 commented Jan 23, 2023

Describe the bug
I am getting BadRequest response while updating the deployment image.
It was working fine with older version. I recently upgraded k8s client to 10.0.1

Here is the request json that I am sending,

{"operations":[{"value":"*****.azurecr.io/****/admin:2022.12.631.86618-release-windows2019","operationType":"Replace","path":"/Spec/Template/Spec/Containers/0/Image","op":"replace"}],"contractResolver":{}}

Response:

{"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"json: cannot unmarshal object into Go value of type jsonpatch.Patch","reason":"BadRequest","code":400}

Kubernetes C# SDK Client Version
10.0.1

Server Kubernetes Version
1.24.6

Dotnet Runtime Version
net6

To Reproduce
Steps to reproduce the behavior:

Try updating the deployment Image,

PatchNamespacedDeployment(V1Patch, Name, NamespaceName)

Expected behavior
It should update the deployment image on server

KubeConfig
If applicable, add a KubeConfig file with secrets redacted.

Where do you run your app with Kubernetes SDK (please complete the following information):

  • OS: Linux
  • Environment: container
  • Cloud: Azure

Additional context
Add any other context about the problem here.

@tg123
Copy link
Member

tg123 commented Jan 23, 2023

see #772
this is likely caused by json patch library
you have to upgrade to jsonpatch.net or libraries support system.text.json

@bhadreshpanchal88
Copy link
Author

see #772 this is likely caused by json patch library you have to upgrade to jsonpatch.net or libraries support system.text.json

I have Microsoft.AspNetCore.JsonPatch v6.0.6 installed.
Should I upgraded it to any more specific version you know ?

@tg123
Copy link
Member

tg123 commented Jan 23, 2023

#772 (comment)

@tg123 tg123 closed this as not planned Won't fix, can't repro, duplicate, stale Jan 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants