Skip to content

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

Closed as not planned
@bhadreshpanchal88

Description

@bhadreshpanchal88

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions