【问题标题】:Fail to patch rc by api?无法通过api修补rc?
【发布时间】:2015-10-21 10:16:35
【问题描述】:

Kubernetes 版本:1.02

补丁/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 的错误吗?

【问题讨论】:

    标签: kubernetes


    【解决方案1】:

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

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

    Content-Type: application/merge-patch+json
    

    【讨论】:

    猜你喜欢
    • 2019-04-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-06-14
    • 1970-01-01
    • 2021-12-31
    相关资源
    最近更新 更多