Troubleshooting kubectl patch Errors for format is not support
When working with Kubernetes and attempting to apply patches to resources using kubectl, encountering compatibility issues can be a common occurrence. One such error message is: "error: application/strategic-merge-patch+json is not supported by mysql.oracle.com/v2, Kind=InnoDBCluster: the body of the request was in an unknown format."
To resolve this issue, the error message suggests that the accepted media types include application/json-patch+json, application/merge-patch+json, and application/apply-patch+yaml. However, running kubectl patch with the --dry-run=client option resulted in another error: "strategic merge patch is not supported for mysql.oracle.com/v2, Kind=InnoDBCluster locally." The suggested solution was to try using the --type merge option, which successfully addressed the problem.
In summary, when encountering the mentioned error while working with kubectl patch, considering the --type merge option might be the key to resolving the issue and successfully applying patches to the specified Kubernetes resource.