Description of problem:
Empty delete-images.yaml file is being generated when oc-mirror delete command is run with only operator images
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.17.0-202407021157.p0.gf8eb3f3.assembly.stream.el9-f8eb3f3", GitCommit:"f8eb3f3ad82c816e82d9f10b2d488dcfb09ce838", GitTreeState:"clean", BuildDate:"2024-07-02T12:33:27Z", GoVersion:"go1.22.4 (Red Hat 1.22.4-2.el9) X:strictfipsruntime", Compiler:"gc", Platform:"linux/amd64"}
How reproducible:
100%
Steps to Reproduce:
1. Using following ics with only operator: apiVersion: mirror.openshift.io/v2alpha1 kind: ImageSetConfiguration mirror: operators: - catalog: registry.redhat.io/redhat/redhat-operator-index:v4.15 packages: - name: devworkspace-operator `oc-mirror -c config.yaml file://outope --v2` `oc-mirror -c config.yaml --from file://outope --v2 docker://localhost:5000 --dest-tls-verify=false` 2. Generate the delete image file by: cat delete-config.yaml kind: DeleteImageSetConfiguration apiVersion: mirror.openshift.io/v2alpha1 delete: operators: - catalog: registry.redhat.io/redhat/redhat-operator-index:v4.15 packages: - name: devworkspace-operator `oc-mirror delete --config delete-config.yaml docker://localhost:5000 --v2 --workspace file://outope --generate`
Actual results:
The command hit error and create empty file for delete-images.yaml ./oc-mirror delete --config delete-config.yaml docker://localhost:5000 --v2 --workspace file://outope --generate 2024/07/12 12:01:15 [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/07/12 12:01:15 [INFO] : 👋 Hello, welcome to oc-mirror 2024/07/12 12:01:15 [INFO] : ⚙️ setting up the environment for you... 2024/07/12 12:01:15 [INFO] : 🔀 workflow mode: diskToMirror / delete 2024/07/12 12:01:15 [ERROR] : [RunDelete] open outope16/working-dir/hold-release/ocp-release: no such file or directory 2024/07/12 12:01:15 [INFO] : 🕵️ going to discover the necessary images... 2024/07/12 12:01:15 [INFO] : 🔍 collecting release images... 2024/07/12 12:01:15 [INFO] : 🔍 collecting operator images... 2024/07/12 12:01:15 [ERROR] : [OperatorImageCollector] pinging container registry localhost:55000: Get "https://localhost:55000/v2/": http: server gave HTTP response to HTTPS client 2024/07/12 12:01:15 [ERROR] : [OperatorImageCollector] pinging container registry localhost:55000: Get "https://localhost:55000/v2/": http: server gave HTTP response to HTTPS client 2024/07/12 12:01:15 [ERROR] : pinging container registry localhost:55000: Get "https://localhost:55000/v2/": http: server gave HTTP response to HTTPS client 2024/07/12 12:01:15 [INFO] : 🔍 collecting additional images... 2024/07/12 12:01:15 [INFO] : 📄 Generating delete file... 2024/07/12 12:01:15 [INFO] : outope16/working-dir/delete file created 2024/07/12 12:01:15 [INFO] : delete time : 2.098511ms 2024/07/12 12:01:15 [INFO] : 👋 Goodbye, thank you for using oc-mirror cat outope16/working-dir/delete/delete-images.yaml apiVersion: mirror.openshift.io/v2alpha1 items: null kind: DeleteImageList
Expected results:
generate correct delete image list for operator images
- duplicates
-
OCPBUGS-37948 oc-mirror throws error when performing delete operation with --generate
- Verified
- is cloned by
-
OCPBUGS-37740 Should not panic when specify wrong loglevel for oc-mirror
- Verified