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

oc-mirror v2 is deleting the images as per delete-imageset.yaml even if we pass a invalid destination registry

XMLWordPrintable

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

      None

      Show
      None

      Description of problem:

        oc-mirror v2 is deleting the images as per delete-imageset.yaml even if we pass a invalid destination registry  

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

      4.17

      How reproducible:

      100% reproducible

      Steps to Reproduce:

      1- Create a DeleteImageSetConfiguration like below:

       

      iVersion: 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
        additionalImages:
         - name: registry.redhat.io/ubi8/ubi:latest
         - name: registry.redhat.io/ubi9/ubi@sha256:20f695d2a91352d4eaa25107535126727b5945bff38ed36a3e59590f495046f0
       

      2- generate a delete-images.yaml

       

       

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

      3- Here, registry:8443 is the actual mirror registry. so try to delete the image by passing a wrong destination mirror registry like below

       

       

      # ./oc-mirror  delete --v2 --delete-yaml-file /opt/417ocmirror/working-dir/delete/delete-images.yaml docker://false-registry:8443/wrong-location 

      4- you can see still the images are getting deleted as per delete-images.yaml. so i am not really what is the use of passing destination registry here.

      2024/11/19 00:23:31  [INFO]   : === Results ===
      2024/11/19 00:23:31  [INFO]   : All images deleted successfully 200 / 200 ✅
      2024/11/19 00:23:31  [INFO]   : delete time     : 1m5.306447513s
      2024/11/19 00:23:31  [INFO]   : 📝 Remember to execute a garbage collect (or similar) on your remote repository
      2024/11/19 00:23:31  [INFO]   : 👋 Goodbye, thank you for using oc-mirror
       

       

      Actual results:

      deleting images even if we pass a wrong destination mirror registry.

      Expected results:

      it should exit if we pass a wrong destination mirror registry.  

      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:
              4 Start watching this issue

                Created:
                Updated: