5.2. 将 MTC 升级到 1.8.0
要将 MTC 升级到 1.8.0,请完成以下步骤。
流程
使用以下方法之一确定要升级的订阅名称和当前频道:
运行以下命令确定订阅名称和频道:
$ oc -n openshift-migration get sub
输出示例
NAME PACKAGE SOURCE CHANNEL mtc-operator mtc-operator mtc-operator-catalog release-v1.7 redhat-oadp-operator-stable-1.0-mtc-operator-catalog-openshift-marketplace redhat-oadp-operator mtc-operator-catalog stable-1.0
或者运行以下命令来返回 JSON 中的订阅名称和频道:
$ oc -n openshift-migration get sub -o json | jq -r '.items[] | { name: .metadata.name, package: .spec.name, channel: .spec.channel }'
输出示例
{ "name": "mtc-operator", "package": "mtc-operator", "channel": "release-v1.7" } { "name": "redhat-oadp-operator-stable-1.0-mtc-operator-catalog-openshift-marketplace", "package": "redhat-oadp-operator", "channel": "stable-1.0" }
对于每个订阅,运行以下命令来从 MTC 1.7 频道迁移到 MTC 1.8 频道:
$ oc -n openshift-migration patch subscription mtc-operator --type merge --patch '{"spec": {"channel": "release-v1.8"}}'
输出示例
subscription.operators.coreos.com/mtc-operator patched
5.2.1. 将 OADP 1.0 升级到 1.2 for Containers 1.8.0
要将 OADP 1.0 升级到 1.2 for Containers 1.8.0,请完成以下步骤。
流程
对于每个订阅,运行以下命令,将 OADP operator 从 OADP 1.0 修补到 OADP 1.2:
$ oc -n openshift-migration patch subscription redhat-oadp-operator-stable-1.0-mtc-operator-catalog-openshift-marketplace --type merge --patch '{"spec": {"channel":"stable-1.2"}}'
注意指示用户特定返回的
NAME
值分别用于安装 MTC 和 OADP 的部分。输出示例
subscription.operators.coreos.com/redhat-oadp-operator-stable-1.0-mtc-operator-catalog-openshift-marketplace patched
注意返回的值与
redhat-oadp-operator-stable-1.0-mtc-operator-catalog-openshift-marketplace
类似,在本示例中使用。-
如果
installPlanApproval
参数设置为Automatic
,Operator Lifecycle Manager (OLM)将开始升级过程。 -
如果将
installPlanApproval
参数设置为Manual
,则必须在 OLM 开始升级前批准每个installPlan
。
-
如果
验证
运行以下命令,验证 OLM 是否已完成 OADP 和 MTC 的升级:
$ oc -n openshift-migration get subscriptions.operators.coreos.com mtc-operator -o json | jq '.status | (."state"=="AtLatestKnown")'
当返回
true
值时,运行以下命令来验证每个订阅使用的频道:$ oc -n openshift-migration get sub -o json | jq -r '.items[] | {name: .metadata.name, channel: .spec.channel }'
输出示例
{ "name": "mtc-operator", "channel": "release-v1.8" } { "name": "redhat-oadp-operator-stable-1.0-mtc-operator-catalog-openshift-marketplace", "channel": "stable-1.2" }
Confirm that the `mtc-operator.v1.8.0` and `oadp-operator.v1.2.x` packages are installed by running the following command:
$ oc -n openshift-migration get csv
输出示例
NAME DISPLAY VERSION REPLACES PHASE mtc-operator.v1.8.0 Migration Toolkit for Containers Operator 1.8.0 mtc-operator.v1.7.13 Succeeded oadp-operator.v1.2.2 OADP Operator 1.2.2 oadp-operator.v1.0.13 Succeeded