patch
使用JSON或YAML格式的策略合并补丁更新对象的一个或多个字段。
#将节点node1的spec.unschedulable字段更新为true
$ oc patch node/node1 -p '{"spec":{"unschedulable":true}}'
#如果需要使用自定义资源定义,则必须在命令中包含--type merge选项。
yaml/json
$ oc get dc
NAME REVISION DESIRED CURRENT TRIGGERED BY
mysql 2 1 1 config,image(mysql:5.7)
Take a copy of the resource in yaml/json format which we want to patch like dc/rc/pod …etc. we can editthe file what patch you want to perform on that resource save to another file.
$ oc get dc/mysql -o yaml > mysql.yaml
$ oc patch -f mysql.yaml --patch="$(cat mysqlpatch.yaml)"
deploymentconfig "mysql" patched
mysql.yaml ----> original mysql deploymentconfig file
mysqlpatch.yaml ----> updated file
so the above example will patch mysql DC get updated to my current resource.