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

Create empty detele-images.yaml file when without the local cache

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not a Bug
    • Icon: Major Major
    • None
    • 4.17
    • oc-mirror
    • Moderate
    • None
    • Rejected
    • False
    • Hide

      None

      Show
      None
    • Hide
      *Cause*: What actions or circumstances cause this bug to present.
      *Consequence*: What happens when the bug presents.
      *Fix*: What was done to fix the bug.
      *Result*: Bug doesn’t present anymore.
      Show
      *Cause*: What actions or circumstances cause this bug to present. *Consequence*: What happens when the bug presents. *Fix*: What was done to fix the bug. *Result*: Bug doesn’t present anymore.
    • Bug Fix
    • In Progress

      Description of problem:

      When delete on operators when the previous command was mirror to mirror with oci format,  with the local cache , hit error and create empty detele-images.yaml file

       

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

         oc-mirror version 
      WARNING: This version information is deprecated and will be replaced with the output from --short. Use --output=yaml|json to get the full version.
      Client Version: version.Info{Major:"", Minor:"", GitVersion:"v0.0.0-unknown-7b0b3bf2", GitCommit:"7b0b3bf2", GitTreeState:"clean", BuildDate:"2024-09-06T01:32:29Z", GoVersion:"go1.23.0", Compiler:"gc", Platform:"linux/amd64"}      

      How reproducible:

           Always
          

      Steps to Reproduce:

          1. do mirror2mirror with following imagesetconfig: 
      cat config-136.yaml 
      apiVersion: mirror.openshift.io/v2alpha1
      kind: ImageSetConfiguration
      mirror:
        operators:
        - catalog: oci:///test/ibm-catalog
        - catalog: registry.redhat.io/redhat/redhat-operator-index:v4.15
          packages:
          - name: windows-machine-config-operator
          - name: cluster-kube-descheduler-operator
        - catalog: registry.redhat.io/redhat/redhat-operator-index:v4.14
          packages:
          - name: servicemeshoperator 
          - name: windows-machine-config-operator
        - catalog: registry.redhat.io/redhat/certified-operator-index:v4.15
          packages:
          - name: nvidia-network-operator
        - catalog: registry.redhat.io/redhat/community-operator-index:v4.15
          packages:
          - name: skupper-operator
          - name: reportportal-operator
        - catalog: registry.redhat.io/redhat/redhat-marketplace-index:v4.15
          packages:
          - name: dynatrace-operator-rhmp
      
      `oc-mirror -c config-136.yaml docker://localhost:5000/m2m06 --workspace file://m2m6 --v2  --dest-tls-verify=false`
      
      2. change to new terminal , without the local cache env 
      3. generate the delete images list with following set: 
      apiVersion: mirror.openshift.io/v2alpha1
      kind: DeleteImageSetConfiguration
      delete:
        operators:
        - catalog: oci:///test/ibm-catalog
        - catalog: registry.redhat.io/redhat/redhat-operator-index:v4.15
          packages:
          - name: windows-machine-config-operator
          - name: cluster-kube-descheduler-operator
        - catalog: registry.redhat.io/redhat/redhat-operator-index:v4.14
          packages:
          - name: servicemeshoperator 
          - name: windows-machine-config-operator
        - catalog: registry.redhat.io/redhat/certified-operator-index:v4.15
          packages:
          - name: nvidia-network-operator
        - catalog: registry.redhat.io/redhat/community-operator-index:v4.15
          packages:
          - name: skupper-operator
          - name: reportportal-operator
        - catalog: registry.redhat.io/redhat/redhat-marketplace-index:v4.15
          packages:
          - name: dynatrace-operator-rhmp
      
      oc-mirror delete -c  config-de.yaml  --generate --workspace file://m2m06-delete docker://localhost:5000/m2m06  --v2

       

      Actual results:

      hit error and the delete image list file is empty: 
      oc-mirror delete -c  config-de.yaml  --generate --workspace file://m2m06-delete docker://localhost:5000/m2m06  --v2 2024/09/06 05:20:00  [WARN]   : ⚠️  --v2 flag identified, flow redirected to the oc-mirror v2 version. This is Tech Preview, it is still under development and it is not production ready.
      2024/09/06 05:20:00  [INFO]   : 👋 Hello, welcome to oc-mirror
      2024/09/06 05:20:00  [INFO]   : ⚙️  setting up the environment for you...
      2024/09/06 05:20:00  [INFO]   : 🔀 workflow mode: diskToMirror / delete
      2024/09/06 05:20:00  [INFO]   : 🕵️  going to discover the necessary images...
      2024/09/06 05:20:00  [INFO]   : 🔍 collecting release images...
      2024/09/06 05:20:00  [INFO]   : 🔍 collecting operator images...
      2024/09/06 05:20:00  [ERROR]  : [OperatorImageCollector] reading manifest latest in localhost:55000/ibm-catalog: manifest unknown
      2024/09/06 05:20:00  [ERROR]  : [OperatorImageCollector] reading manifest latest in localhost:55000/ibm-catalog: manifest unknown
      2024/09/06 05:20:00  [ERROR]  :  reading manifest latest in localhost:55000/ibm-catalog: manifest unknown
      2024/09/06 05:20:00  [INFO]   : 🔍 collecting additional images...
      2024/09/06 05:20:00  [INFO]   : 📄 Generating delete file...
      2024/09/06 05:20:00  [INFO]   : m2m06-delete/working-dir/delete file created
      2024/09/06 05:20:00  [INFO]   : delete time     : 7.154958ms
      2024/09/06 05:20:00  [INFO]   : 👋 Goodbye, thank you for using oc-mirror
      [fedora@preserve-fedora-yinzhou yinzhou]$ cat m2m06-delete/working-dir/delete/delete-images.yaml 
      apiVersion: mirror.openshift.io/v2alpha1
      items: null
      kind: DeleteImageList
         

      Expected results:

         no error and create correct delete image list file. 

      Additional info:

          

              luzuccar@redhat.com Luigi Mario Zuccarelli
              yinzhou@redhat.com ying zhou
              ying zhou ying zhou
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: