2015-10-19 75 views
2

Kubernetes verison:1.02无法通过api修补rc?

PATCH/API/V1 /命名空间/默认/ replicationcontrollers /测试

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 
}' 

这是对API的错误吗?

回答

6

对于PATCH工作,您需要发送accepted content-type header values之一。

你的榜样使用merge patch,所以你应该送:

Content-Type: application/merge-patch+json 
+0

谢谢修补方法是现在工作! – ttyyll

+0

谢谢,错过了文档中的CONSUMES部分 - https://docs.openshift.com/container-platform/3.4/rest_api/openshift_v1.html#consumes-128 – hipokito