Fail to patch rc by api?

10/19/2015

Kubernetes verison: 1.02

PATCH /api/v1/namespaces/default/replicationcontrollers/test

body  
{"spec":  
{"replicas": 3}  
}  

response  
'{  
"kind": "Status",  
"apiVersion": "v1",  
"metadata": {},  
"status": "Failure",  
"message": "the server responded with the status code 415 but did not return more information",  
"details": {},  
"code": 415  
}'  

Is this a bug for API?

-- ttyyll
kubernetes

1 Answer

10/20/2015

For PATCH to work you need to send one of the accepted content-type header values.

Your example uses a merge patch, so you should send:

Content-Type: application/merge-patch+json
-- n-p
Source: StackOverflow