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

oc-mirror v2 automatically deleting the manifests which are generated under working-dir/cluster-resources while generating delete-images.yaml

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Normal Normal
    • None
    • 4.17
    • oc-mirror
    • None
    • False
    • Hide

      None

      Show
      None

      Description of problem:

      While generating delete-images.yaml for the pruning of images using oc-mirror v2, the manifest which are generated under working-dir/cluster-resources (IDMS,ITMS etc) are getting deleted automatically   

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

      4.17

      How reproducible:

      100% reproducible

      Steps to Reproduce:

      1- Create a DeleteImageSetConfiguration file like below

      apiVersion: mirror.openshift.io/v2alpha1
      kind: DeleteImageSetConfiguration
      delete:
        platform:
          channels:
          - name: stable-4.17
            minVersion: 4.17.3
            maxVersion: 4.17.3
        operators:
          - catalog: registry.redhat.io/redhat/redhat-operator-index:v4.17
            packages:
             - name: aws-load-balancer-operator
             - name: node-observability-operator
             - name: 3scale-operator
        additionalImages:
         - name: registry.redhat.io/ubi8/ubi:latest
         - name: registry.redhat.io/ubi9/ubi@sha256:20f695d2a91352d4eaa25107535126727b5945bff38ed36a3e59590f495046f0
       

      2- ensure that the manifest are generated by the oc-mirror are present in the working-dir/cluster-resources 

       

       ls -lrth /opt/417ocmirror/working-dir/cluster-resources/
      total 16K
      
      -rw-r--r--. 1 root root 491 Nov 18 21:57 itms-oc-mirror.yaml
      -rw-r--r--. 1 root root 958 Nov 18 21:57 idms-oc-mirror.yaml
      -rw-r--r--. 1 root root 322 Nov 18 21:57 updateService.yaml
      -rw-r--r--. 1 root root 268 Nov 18 21:57 cs-redhat-operator-index-v4-17.yaml
       

      3- Generate the delete-images.yaml using below command

       

      ./oc-mirror  delete --config ./deleteimageset.yaml --workspace file:///opt/417ocmirror --v2 --generate docker://bastionmirror.amuhamme.upi:8443/417images2024/11/18 23:53:12  [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/11/18 23:53:12  [INFO]   : 👋 Hello, welcome to oc-mirror
      2024/11/18 23:53:12  [INFO]   : ⚙️  setting up the environment for you...
      2024/11/18 23:53:12  [INFO]   : 🔀 workflow mode: diskToMirror / delete
      2024/11/18 23:53:12  [INFO]   : 🕵️  going to discover the necessary images...
      2024/11/18 23:53:12  [INFO]   : 🔍 collecting release images...
      2024/11/18 23:53:12  [INFO]   : 🔍 collecting operator images...
      2024/11/18 23:53:13  [INFO]   : 🔍 collecting additional images...
      2024/11/18 23:53:13  [INFO]   : 📄 Generating delete file...
      2024/11/18 23:53:13  [INFO]   : /opt/417ocmirror/working-dir/delete file created
      2024/11/18 23:53:13  [INFO]   : delete time     : 712.42082ms
      2024/11/18 23:53:13  [INFO]   : 👋 Goodbye, thank you for using oc-mirror
       

      4- Verify after generating the delete-images.yaml  the manifests present in the working-dir/cluster-resources/ got deleted.

       

      # ls -lrth /opt/417ocmirror/working-dir/cluster-resources/
      total 0
      
      # ls -lrth /opt/417ocmirror/working-dir/delete
      total 72K
      -rwxr-xr-x. 1 root root 65K Nov 18 23:53 delete-images.yaml
      -rwxr-xr-x. 1 root root 617 Nov 18 23:53 delete-imageset-config.yaml
       

      Actual results:

      Generating delete-images.yaml is deleting the manifest under working-dir/cluster-resources/

      Expected results:

      Generating delete-images.yaml  should not delete the manifest under working-dir/cluster-resources/

      Additional info:

          

              luzuccar@redhat.com Luigi Mario Zuccarelli
              rhn-support-amuhamme MUHAMMED ASLAM V K
              ying zhou ying zhou
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated: