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

oc does not preserve a speficic release image provided with --to-image=''

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Do
    • Undefined
    • None
    • 4.14.0
    • oc
    • None
    • Moderate
    • No
    • False
    • Hide

      None

      Show
      None

    Description

      This is a clone of issue OCPBUGS-14249. The following is the description of the original issue:

      This is a clone of issue OCPBUGS-12901. The following is the description of the original issue:

      Description of problem:

      When a (recommended/conditional) release image is provided with --to-image='', the specified image name is not preserved in the ClusterVersion object.

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

       

      How reproducible:

      100% with oc >4.9

      Steps to Reproduce:

      $ oc version
      Client Version: 4.12.2
      Kustomize Version: v4.5.7
      Server Version: 4.12.2
      Kubernetes Version: v1.25.4+a34b9e9
      
      $ oc get clusterversion/version -o jsonpath='{.status.desired}'|jq
      {
        "channels": [
          "candidate-4.12",
          "candidate-4.13",
          "eus-4.12",
          "fast-4.12",
          "stable-4.12"
        ],
        "image": "quay.io/openshift-release-dev/ocp-release@sha256:31c7741fc7bb73ff752ba43f5acf014b8fadd69196fc522241302de918066cb1",
        "url": "https://access.redhat.com/errata/RHSA-2023:0569",
        "version": "4.12.2"
      }
      $ oc adm release info 4.12.3 -o jsonpath='{.image}'
      quay.io/openshift-release-dev/ocp-release@sha256:382f271581b9b907484d552bd145e9a5678e9366330059d31b007f4445d99e36
      $ skopeo copy docker://quay.io/openshift-release-dev/ocp-release@sha256:382f271581b9b907484d552bd145e9a5678e9366330059d31b007f4445d99e36 docker://quay.example.com/playground/release-images
      Getting image source signatures
      Copying blob 64096b96a7b0 done  
      Copying blob 0e0550faf8e0 done  
      Copying blob 97da74cc6d8f skipped: already exists  
      Copying blob d8190195889e skipped: already exists  
      Copying blob 17997438bedb done  
      Copying blob fdbb043b48dc done  
      Copying config b49bc8b603 done  
      Writing manifest to image destination
      Storing signatures
      $ skopeo inspect docker://quay.example.com/playground/release-images@sha256:382f271581b9b907484d552bd145e9a5678e9366330059d31b007f4445d99e36|jq '.Name,.Digest'
      "quay.example.com/playground/release-images"
      "sha256:382f271581b9b907484d552bd145e9a5678e9366330059d31b007f4445d99e36"
      $ oc adm upgrade --to-image=quay.example.com/playground/release-images@sha256:382f271581b9b907484d552bd145e9a5678e9366330059d31b007f4445d99e36 Requesting update to 4.12.3                               
       

      Actual results:

      $ oc get clusterversion/version -o jsonpath='{.status.desired}'|jq
      {
        "channels": [
          "candidate-4.12",
          "candidate-4.13",
          "eus-4.12",
          "fast-4.12",
          "stable-4.12"
        ],
        "image": "quay.io/openshift-release-dev/ocp-release@sha256:382f271581b9b907484d552bd145e9a5678e9366330059d31b007f4445d99e36",    <--- not quay.example.com
        "url": "https://access.redhat.com/errata/RHSA-2023:0728",
        "version": "4.12.3"
      }
      
      $ oc get clusterversion/version -o jsonpath='{.status.history}'|jq
      [
        {
          "completionTime": null,
          "image": "quay.io/openshift-release-dev/ocp-release@sha256:382f271581b9b907484d552bd145e9a5678e9366330059d31b007f4445d99e36",         <--- not quay.example.com
          "startedTime": "2023-04-28T07:39:11Z",
          "state": "Partial",
          "verified": true,
          "version": "4.12.3"
        },
        {
          "completionTime": "2023-04-27T14:48:06Z",
          "image": "quay.io/openshift-release-dev/ocp-release@sha256:31c7741fc7bb73ff752ba43f5acf014b8fadd69196fc522241302de918066cb1",
          "startedTime": "2023-04-27T14:24:29Z",
          "state": "Completed",
          "verified": false,
          "version": "4.12.2"
        }
      ]

      Expected results:

      $ oc get clusterversion/version -o jsonpath='{.status.desired}'|jq
      {
        "channels": [
          "candidate-4.12",
          "candidate-4.13",
          "eus-4.12",
          "fast-4.12",
          "stable-4.12"
        ],
        "image": "quay.example.com/playground/release-images@sha256:382f271581b9b907484d552bd145e9a5678e9366330059d31b007f4445d99e36 ",
        "url": "https://access.redhat.com/errata/RHSA-2023:0728",
        "version": "4.12.3"
      }$ oc get clusterversion/version -o jsonpath='{.status.history}'|jq
      [
        {
          "completionTime": null,
          "image": "quay.example.com/playground/release-images@sha256:382f271581b9b907484d552bd145e9a5678e9366330059d31b007f4445d99e36 ",
          "startedTime": "2023-04-28T07:39:11Z",
          "state": "Partial",
          "verified": true,
          "version": "4.12.3"
        },
        {
          "completionTime": "2023-04-27T14:48:06Z",
          "image": "quay.io/openshift-release-dev/ocp-release@sha256:31c7741fc7bb73ff752ba43f5acf014b8fadd69196fc522241302de918066cb1",
          "startedTime": "2023-04-27T14:24:29Z",
          "state": "Completed",
          "verified": false,
          "version": "4.12.2"
        }
      ]

      Additional info:

      While in earlier versions (<4.10) we used to preserve the specified image [1], we now (as of 4.10) store the public image as the desired version [2].
      [1] https://github.com/openshift/oc/blob/88cfeb4aa2d74ee5f5598c571661622c0034081b/pkg/cli/admin/upgrade/upgrade.go#L278
      [2] https://github.com/openshift/oc/blob/5711859fac135177edf07161615bdabe3527e659/pkg/cli/admin/upgrade/upgrade.go#L278 

      Attachments

        Issue Links

          Activity

            People

              rhn-support-bverschu Bram Verschueren
              openshift-crt-jira-prow OpenShift Prow Bot
              ying zhou ying zhou
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: