我正试着看看如何通过跟随OpenShift Pod-Patch Rest Documentation来修补Pod for OpenShift Via Rest。我已经能够使用OpenShift中的其他api发布数据,例如Secret。
如果我只是为了更新给定pod的元数据名称而进行curl调用:
curl -k \
-X PATCH \
-d @- \
-H "Authorization: Bearer $TOKEN" \
-H 'Accept: application/json' \
-H 'Content-Type: application/json-patch+json' \
$OPENSHIFT_URL/api/v1/namespaces/mytestproject/pods/app-1-build << 'EOF'
{
"kind": "Pod",
"apiVersion": "v1",
"metadata": {
"name": "app-2-build"
}
}
EOF
我收到回复:
{
"kind": "Status",
"apiVersion": "v1",
"metadata": {},
"status": "Failure",
"message": "json: cannot unmarshal object into Go value of type jsonpatch.Patch",
"code": 500
}
我无法根据架构弄清楚我做错了什么,而OpenShift for pod中的文档没有显示curl示例中json data schema的示例。