I am trying to update status subresource for a Custom Resource and I see a discrepency with curl and kubectl patch
commands. when I use curl call it works perfectly fine but when I use kubectl patch
command it says patched but with no change
. Here are the command that I used
Using Curl:
When I connect to kubectl proxy
and run the below curl call, it's successful and updates status subresource on my CR.
curl -XPATCH -H "Accept: application/json" -H "Content-Type: application/json-patch+json" --data '[{"op": "replace", "path": "/status/state", "value": "newState"}]' 'http://127.0.0.1:8001/apis/acme.com/v1alpha1/namespaces/acme/myresource/default/status'
Kubectl patch command:
Using kubectl patch says the CR is patch but with no change
and the status sub-resource is updated.
$ kubectl -n acme patch myresource default --type='json' -p='[{"op": "replace", "path": "/status/state", "value":"newState"}]'
myresource.acme.com/default patched (no change)
However when I do the kubectl patch
on the other sub-resources like spec
it works fine. Am i missing something here?