Skip to content

KubernetesClient 7.x patching broken #772

Closed
@rogeralsing

Description

@rogeralsing

asynkron/protoactor-dotnet#1416

After upgrading to KubernetesClient 7.0.8, we are seeing the following error returned from k8s when trying to patch pod labels:

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

After adding a delegating logger to the HttpClient, we are seeing this payload being sent:

{
    "operations": [
        {
            "value": {
                "label xyz":"value xyz"
            },
            "operationType": "Replace",         //<---- This entry is not part of the Patch spec
            "path": "/Metadata/Labels",
            "op": "replace"
        }
    ],
    "contractResolver": {}
}

Downgrading to KubernetesClient 6.0.8 works, and does not have this invalid extra entry:

{
    "operations": [
        {
            "value": {
                "label xyz":"value xyz"
            },
            "path": "/Metadata/Labels",
            "op": "replace"
        }
    ],
    "contractResolver": {}
}

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