2015-10-19 59 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