我一直试图在openshift中修补具有备用后端的路由。
我尝试过:
codes
错误:static func fetchCodes(person: Person) -> [Codes] {
return person.codes
}
oc patch route/image-mirror-poc --patch '{"spec":{"alternateBackends": "kind:Service" "name:image-mirror-poc-blue" "weight:75"}}'
错误:Error from server: invalid character '"' after object key:value pair
oc patch route/image-mirror-poc --patch '{"spec":{"alternateBackends": "kind:Service", "name:image-mirror-poc-blue", "weight:75"}}'
错误:Error from server: invalid character ',' after object key
我取消了当前路线规格,看起来像这样:
oc patch route/image-mirror-poc --patch '{"spec":{"alternateBackends": ["kind:Service", "name:image-mirror-poc-blue", "weight:75"]}}'
我一直在尝试遵循documentation,但没有成功。
Openshift信息:
Error from server: cannot restore struct from: string
答案 0 :(得分:2)
这种格式怎么样?如果更改不算什么,则patch
命令将不更改而结束。
oc patch route/image-mirror-poc --patch'{"spec": {"alternateBackends": [{"kind": "Service","name": "image-mirror-poc-blue","weight": 75}]}}'