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

Image delete function for v2 does not delete any images in the registry

XMLWordPrintable

    • Important
    • None
    • CLID Sprint 253
    • 1
    • False
    • Hide

      None

      Show
      None
    • N/A
    • Release Note Not Required
    • In Progress
    • Customer Facing

      Description of problem:

      Image delete function for v2 does not delete any images in the registry

       

      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:"4.16.0-202404191609.p0.g9ac063b.assembly.stream.el9-9ac063b", GitCommit:"9ac063b0b88466183a50287af277c5ed40a8e238", GitTreeState:"clean", BuildDate:"2024-04-19T22:03:51Z", GoVersion:"go1.21.7 (Red Hat 1.21.7-1.el9) X:strictfipsruntime", Compiler:"gc", Platform:"linux/amd64"}

      How reproducible:

      always

      Steps to Reproduce:

      1) Use following isc to do mirror for v2: cat config.yaml
      kind: ImageSetConfiguration
      apiVersion: mirror.openshift.io/v1alpha2
      mirror:
        platform:
          channels:
            - name: stable-4.15
        operators:
          - catalog: registry.redhat.io/redhat/redhat-operator-index:v4.14
            packages:
            - name: 3scale-operator
      
      `oc-mirror --config config.yaml file://out --v2`
      `oc-mirror --config config.yaml  --from file://out --v2 docker://localhost:5000`
      
          2) Generate the delete yaml file :  
      cat config-delete.yaml 
      apiVersion: mirror.openshift.io/v1alpha2
      kind: DeleteImageSetConfiguration
      delete:
        platform:
          channels:
            - name: stable-4.15
        operators:
          - catalog: registry.redhat.io/redhat/redhat-operator-index:v4.14
            packages:
            - name: 3scale-operator
      
      `oc-mirror  delete --config config-delete.yaml --workspace file://out --v2 --generate docker://localhost:5000`
      
      3) Execute the delete function : 
      `oc-mirror delete --v2 --delete-yaml-file  out/working-dir/delete/delete-images.yaml  docker://localhost:5000 --force-cache-delete=true`

      Actual results: 

      3) The delete command succeeded , but checked the registry , no data deleted , the registry size no change , the catalog no change.
      
      Before delete the registry size :  du --max-depth=1 -h29G ./v229G  
      
      After delete the registry size : du --max-depth 1 -h29G ./v229G
      
      
      Before delete the catalog in registry :
      curl http://localhost:5000/v2/_catalog |json_reformat
      {
          "repositories": [
              "3scale-amp2/3scale-rhel7-operator",
              "3scale-amp2/3scale-rhel7-operator-metadata",
              "3scale-amp2/apicast-gateway-rhel8",
              "3scale-amp2/backend-rhel8",
              "3scale-amp2/memcached-rhel7",
              "3scale-amp2/searchd-rhel7",
              "3scale-amp2/system-rhel7",
              "3scale-amp2/zync-rhel9",
              "openshift-release-dev/ocp-release",
              "openshift-release-dev/ocp-v4.0-art-dev",
              "openshift4/ose-cli",
              "redhat/redhat-operator-index",
              "rhel8/mysql-80",
              "rhel8/redis-6",
              "rhscl/postgresql-10-rhel7"
          ]
      }
      
      
      After delete the catalog in registry : 
      curl http://localhost:5000/v2/_catalog |json_reformat
      {
          "repositories": [
              "3scale-amp2/3scale-rhel7-operator",
              "3scale-amp2/3scale-rhel7-operator-metadata",
              "3scale-amp2/apicast-gateway-rhel8",
              "3scale-amp2/backend-rhel8",
              "3scale-amp2/memcached-rhel7",
              "3scale-amp2/searchd-rhel7",
              "3scale-amp2/system-rhel7",
              "3scale-amp2/zync-rhel9",
              "openshift-release-dev/ocp-release",
              "openshift-release-dev/ocp-v4.0-art-dev",
              "openshift4/ose-cli",
              "redhat/redhat-operator-index",
              "rhel8/mysql-80",
              "rhel8/redis-6",
              "rhscl/postgresql-10-rhel7"
          ]
      }
      
      
      
      
      Expected results:
      3) delete the data in the registry

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

                Created:
                Updated:
                Resolved: