Description of problem:
oc-mirror delete should not exit or fail if one of the images listed in the delete-images.yaml file is not present in the registry or was already deleted in a previous attempt.
Version-Release number of selected component (if applicable):
4.20 latest version
How reproducible:
100%
Steps to Reproduce:
1- mirror images using an imagesetconfig file like below:
kind: ImageSetConfiguration apiVersion: mirror.openshift.io/v2alpha1 mirror: additionalImages: - name: quay.io/prometheus/node-exporter:v1.10.2 - name: quay.io/prometheus/node-exporter:v1.10.1
2- Generate a delete-images.yaml to delete only 1 image from above mirrored images
bash-5.1# cat workspace/working-dir/delete/delete-images.yaml apiVersion: mirror.openshift.io/v2alpha1 items: - imageName: quay.io/prometheus/node-exporter:v1.10.1 imageReference: docker://<registry>/test/prometheus/node-exporter:v1.10.1 type: generic kind: DeleteImageList
Above delete operation will delete respective image from the registry
3- Try generating another delete-images.yaml that includes both the already deleted image and a second image, and then attempt the delete operation. In this case, oc-mirror delete exits with the message shown below, even though the second image is successfully deleted.
✓ (0s) node-exporter:v1.10.1 ➡️ <registry>/test/prometheus/ ✗ (0s) node-exporter:v1.10.0 ➡️ <registry>/test/prometheus/ 2025/12/15 20:13:46 [INFO] : === Results === 2025/12/15 20:13:46 [INFO] : ✗ 1 / 2 additional images deleted: Some additional images failed to be deleted - please check the logs 2025/12/15 20:13:46 [ERROR] : [Worker] error mirroring image quay.io/prometheus/node-exporter:v1.10.0 error: Unable to delete <registry>/test/prometheus/node-exporter:v1.10.0. Image may not exist or is not stored with a v2 Schema in a v2 registry 2025/12/15 20:13:46 [WARN] : error during registry deletion: [Worker] some errors occurred during the mirroring. Please review logs/mirroring_errors_.txt for a list of mirroring errors. You may consider: * removing images or operators that cause the error from the image set config, and retrying * keeping the image set config (images are mandatory for you), and retrying * mirroring the failing images manually, if retries also fail. 2025/12/15 20:13:46 [ERROR] : [Worker] some errors occurred during the mirroring. Please review logs/mirroring_errors_.txt for a list of mirroring errors. You may consider: * removing images or operators that cause the error from the image set config, and retrying * keeping the image set config (images are mandatory for you), and retrying * mirroring the failing images manually, if retries also fail.
Actual results:
oc-mirror delete exits even though the second image is successfully deleted.
Expected results:
oc-mirror delete exits if the image is not available in the registry
Additional info: