Skip to content

Patch fails on custom resouce with UnsupportedMediaType error #838

@dominic-p

Description

@dominic-p

Describe the bug
When I try to run a patch operation on a custom resource, I get an error like this:

the body of the request was in an unknown format - accepted media types include: application/json-patch+json, application/merge-patch+json, application/apply-patch+yaml

Some Googling took me to this issue which indicates that the solution is to use a different patch type for custom resources. It looks like right now the strategic merge patch is the default for all patch requests.

Of course, I can override the headers which is great. But, could that code be made "smarter" to recognize if we are patching a custom resource and then default to a different patch strategy?

Client Version
0.16.3

Server Version
1.23.7

Metadata

Metadata

Assignees

No one assigned

    Labels

    lifecycle/rottenDenotes an issue or PR that has aged beyond stale and will be auto-closed.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions