无法通过api修补rc?

时间:2015-10-19 01:08:43

标签: kubernetes

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

这是API的错误吗?

1 个答案:

答案 0 :(得分:6)

要使PATCH正常工作,您需要发送一个accepted content-type header values

您的示例使用了merge patch,因此您应该发送:

Content-Type: application/merge-patch+json