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

Cluster version is getting upgraded with force command even when it is set to Upgradable=False

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not a Bug
    • Icon: Major Major
    • None
    • 4.18.z
    • oc / update
    • None
    • Quality / Stability / Reliability
    • False
    • Hide

      None

      Show
      None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Description of problem:

      According to this PR: https://github.com/openshift/machine-config-operator/pull/4822 . Cluster should not get upgraded to later versions when Upgradable=False, but it is getting upgraded with force command.
          

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

      
          

      How reproducible:

      
          

      Steps to Reproduce:

          1. Install 4.18 cluster
          2. For 4.18 the default cgroup version is cgroupv2 so upgradable is set to True:
      $ oc debug node/ip-10-0-19-184.us-east-2.compute.internal
      Starting pod/ip-10-0-19-184us-east-2computeinternal-debug-fl7pq ...
      To use host binaries, run `chroot /host`
      Pod IP: 10.0.19.184
      If you don't see a command prompt, try pressing enter.
      sh-5.1# chroot /host 
      sh-5.1# stat -c %T -f /sys/fs/cgroup
      cgroup2fs
      
       oc get co machine-config -o=jsonpath='{.status.conditions[?(@.type=="Upgradeable")].status}'
      True
      
          3. Check for the updates:  
      oc patch clusterversion/version --patch '{"spec":{"upstream":"https://amd64.ocp.releases.ci.openshift.org/graph"}}' --type=merge
      clusterversion.config.openshift.io/version patched
      
      $ oc adm upgrade
      Cluster version is 4.18.6
      
      Upstream: https://amd64.ocp.releases.ci.openshift.org/graph
      Channel: stable-4.18
      
      Recommended updates:
      
        VERSION     IMAGE
        4.18.7      registry.ci.openshift.org/ocp/release@sha256:91037938dc2ebc2732e7baa6eb4192fa4376abab19f0f545848a87ab7c91931d
      
      4. Now change the cgroup version from cgroupv2 to cgroupv1 in nodes.config . It will change upgradable=Flase.
      
      $ oc edit nodes.config/cluster
      node.config.openshift.io/cluster edited
      
      5. Wait for mcp to finish roll up then check the status:
      $ oc get co machine-config -o=jsonpath='{.status.conditions[?(@.type=="Upgradeable")].status}'
      False
      
      6. $ oc adm upgrade
      Cluster version is 4.18.6
      
      Upgradeable=False
      
        Reason: ClusterOnCgroupV1
        Message: Cluster operator machine-config should not be upgraded between minor versions: Cluster is using deprecated cgroup v1, which is removed in 4.19.  Please update the `CgroupMode` in the `nodes.config.openshift.io` object to 'v2'. This can be changed back to 'v1' while on 4.18, but must be 'v2' before you update to 4.19.  Once updated to 4.19, cgroup v1 is no longer an option
      
      Upstream: https://amd64.ocp.releases.ci.openshift.org/graph
      Channel: stable-4.18
      
      MCO error message will come
      
      7. Now try upgrading it with force command:
      $ oc adm upgrade --to-image=registry.ci.openshift.org/ocp/release:4.19.0-0.nightly-2025-04-02-170034 --force --allow-explicit-upgrade
      warning: Using by-tag pull specs is dangerous, and while we still allow it in combination with --force for backward compatibility, it would be much safer to pass a by-digest pull spec instead
      warning: The requested upgrade image is not one of the available updates. You have used --allow-explicit-upgrade for the update to proceed anyway
      warning: --force overrides cluster verification of your supplied release image and waives any update precondition failures.
      Requested update to release image registry.ci.openshift.org/ocp/release:4.19.0-0.nightly-2025-04-02-170034
      
      $ oc get clusterversion
      NAME      VERSION                              AVAILABLE   PROGRESSING   SINCE   STATUS
      version   4.19.0-0.nightly-2025-04-02-170034   True        False         18m     Cluster version is 4.19.0-0.nightly-2025-04-02-170034
      
          

      Actual results:

      Cluster got upgraded 
          

      Expected results:

      It should not
          

      Additional info:

      
          

              lmohanty@redhat.com Lalatendu Mohanty
              asahay@redhat.com Aditi Sahay
              None
              Neeraj Krishna Gopalakrishna, Sai Ramesh Vanka
              Cameron Meadors Cameron Meadors
              None
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: