3.5.2. 使用 CLI 卸载 OpenShift Update Service Operator

您可以使用 OpenShift CLI(oc)卸载 OpenShift Update Service Operator。

先决条件

  • 所有 OpenShift Update Service 应用都已删除。

流程

  1. 更改到包含 OpenShift Update Service Operator 的项目,如 openshift-update-service

    $ oc project openshift-update-service

    输出示例

    Now using project "openshift-update-service" on server "https://example.com:6443".

  2. 获取 OpenShift Update Service Operator operator 组的名称:

    $ oc get operatorgroup

    输出示例

    NAME                             AGE
    openshift-update-service-fprx2   4m41s

  3. 删除 operator 组,如 openshift-update-service-fprx2

    $ oc delete operatorgroup openshift-update-service-fprx2

    输出示例

    operatorgroup.operators.coreos.com "openshift-update-service-fprx2" deleted

  4. 获取 OpenShift Update Service Operator 订阅的名称:

    $ oc get subscription

    输出示例

    NAME                      PACKAGE                   SOURCE                        CHANNEL
    update-service-operator   update-service-operator   updateservice-index-catalog   v1

  5. 使用上一步中的 Name 值,在 currentCSV 字段中检查订阅的 OpenShift Update Service Operator 的当前版本:

    $ oc get subscription update-service-operator -o yaml | grep " currentCSV"

    输出示例

      currentCSV: update-service-operator.v0.0.1

  6. 删除订阅,如 update-service-operator

    $ oc delete subscription update-service-operator

    输出示例

    subscription.operators.coreos.com "update-service-operator" deleted

  7. 使用上一步中的 currentCSV 值删除 OpenShift Update Service Operator 的 CSV:

    $ oc delete clusterserviceversion update-service-operator.v0.0.1

    输出示例

    clusterserviceversion.operators.coreos.com "update-service-operator.v0.0.1" deleted