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

[v2] oc-mirror DeleteImageSetConfiguration does not delete images from registry

XMLWordPrintable

    • Quality / Stability / Reliability
    • False
    • Hide

      None

      Show
      None
    • None
    • Moderate
    • None
    • None
    • None
    • CLID Sprint 274, CLID Sprint 275, CLID Sprint 276
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Description of problem:

      Using oc-mirror v2, we have mirrored the rhacs-operator to our private Quay mirror registry using the following ImageSetConfiguration YAML file:
      (following the official documentation for mirroring)

      kind: ImageSetConfiguration
      apiVersion: mirror.openshift.io/v2alpha1
      mirror:
      operators:

      • catalog: registry.redhat.io/redhat/redhat-operator-index:v4.15
        full: false
        packages:
      • name: rhacs-operator
        channels:
      • name: stable

      The following command was used to mirror the operator with the above yaml file:

      1. oc-mirror --v2 -c ./imageset-config-rhacs-4.7.2.yaml --log-level debug --workspace file:////data/oc-mirror/workdir/ docker://bastion.pok.stglabs.ibm.com:444/phil/mirror/4.15.operators

      This successfully mirrored the rhacs operator to our private Quay registry. We can view the image from the Quay web console and add the operator via Operator Hub. All is fine with the image.

      Next, we wanted to delete the operator image from our private Quay registry using the following DeleteImageSetConfiguration YAML file:
      (following the official documentation for deleting)

      apiVersion: mirror.openshift.io/v2alpha1
      kind: DeleteImageSetConfiguration
      delete:
      operators:

      • catalog: <hostname redacted>:444/phil/mirror/4.15.operators/redhat/redhat-operator-index:v4.15
        packages:
      • name: rhacs-operator
        channels:
      • name: stable

      The following command was used to delete the operator with the above yaml file:

      1. oc-mirror --v2 delete --delete-yaml-file ./delete-imageset-config-rhacs-4.7.2.yaml --log-level debug docker://bastion.pok.stglabs.ibm.com:444:/phil/mirror/4.15.operators

      From the command output, it starts to delete images, but 0 are deleted. When checking the Quay registry, no images are removed. As noted in the documentation, garbage collection may vary with each registry. Currently, all garbage collection happens discreetly in Quay, and there are no commands to manually run garbage collection.

      I proceeded to test the mirroring and deletion using oc-mirror v2 with a docker registry. I initiated the docker registry garbage collection and the images still exist. I do not believe the images are being deleted within any registry based on the oc-mirror v2 output.

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

      How reproducible:
      Consistently

      Steps to Reproduce:
      1. Using oc-mirror v2 to mirror an operator with ImageSetConfiguration file.
      2. Verify image exists in registry.
      3. Using oc-mirror v2 to delete an operator with DeleteImageSetConfiguration file.
      4. Image still present in registry.

      Actual results: Image in registry is not deleted.

      Expected results: Image in registry is deleted.

      Additional info: I have tested passing in the Operator catalog image for deletion, which should delete all the images, but that does not delete any images. I have explicitly added an image using "additionalImages:" within the yaml file, and that does not delete the image(s) either.

              rh-ee-aguidi Alex Guidi
              phchan@redhat.com Phil Chan
              Phil Chan
              None
              None
              None
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: