Uploaded image for project: 'OpenShift Bugs'
  1. OpenShift Bugs
  2. OCPBUGS-3714

'oc adm upgrade ...' should expose ClusterVersion Failing=True

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Normal Normal
    • None
    • 4.13, 4.12, 4.11, 4.10, 4.9, 4.8
    • oc
    • None
    • Moderate
    • None
    • 3
    • False
    • Hide

      None

      Show
      None
    • Hide
      Previously, use of the `oc adm upgrade` command could change the behavior of the `ClusterOperator` custom resource (CR) object. In that, the object could impact the deployed cluster from receiving updates. Now, the `oc adm upgrade` command accepts a `Failing=True` status condition flag, so that the `ClusterOperator` CR object can summarize a cluster's state. This means, that you can fix any issues before you proceed with applying updates to your cluster. (link:https://issues.redhat.com/browse/OCPBUGS-3714[*OCPBUGS-3714*])
      Show
      Previously, use of the `oc adm upgrade` command could change the behavior of the `ClusterOperator` custom resource (CR) object. In that, the object could impact the deployed cluster from receiving updates. Now, the `oc adm upgrade` command accepts a `Failing=True` status condition flag, so that the `ClusterOperator` CR object can summarize a cluster's state. This means, that you can fix any issues before you proceed with applying updates to your cluster. (link: https://issues.redhat.com/browse/OCPBUGS-3714 [* OCPBUGS-3714 *])
    • Bug Fix
    • Done

      Description of problem:

      Since way back in 2019, oc adm upgrade ... has been looking at ClusterVersion conditions, expecting to see Degraded. But Degraded is strictly a ClusterOperator thing. ClusterVersion fills a similar role with Failing (although it's not clear to me why folks decided against sticking with the same condition slug for the similar roles). We should pivot oc adm upgrade ... to look for the Failing that might actually exist in ClusterVersion.

      Version-Release number of selected component (if applicable):

      All released oc in v4.

      How reproducible:

      100%

      Steps to Reproduce:

      1. Scale down the cluster-version operator: oc scale --replicas 0 -n openshift-cluster-version deployments/cluster-version-operator
      2. Patch in a failing condition:

      $ CONDITIONS="$(oc get -o json clusterversion version | jq -c '[.status.conditions[] | if .type == "Failing" then .status = "True" | .message = "Seriously bad things going on." else . end]')"
      $ oc patch --subresource status clusterversion version --type json -p "[{\"op\": \"add\", \"path\": \"/status/conditions\", \"value\": ${CONDITIONS}}]"
      

      3. Check status: oc adm upgrade
      4. Ask for an update: oc adm upgrade --allow-explicit-upgrade --to-image quay.io/openshift-release-dev/ocp-release@sha256:b8307ac0f3ec4ac86c3f3b52846425205022da52c16f56ec31cbe428501001d6

      Actual results:

      Neither step 3 nor 4 mentions the Failing=True condition.

      Expected results:

      Both step 3 and 4 mention the Failing=True condition, and step 4 fails requesting --allow-upgrade-with-warnings if you want to update anyway.

            trking W. Trevor King
            trking W. Trevor King
            Evgeni Vakhonin Evgeni Vakhonin
            Darragh Fitzmaurice Darragh Fitzmaurice
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: