Description of problem:
For same image , v1 has more than 1 tags , but for v2 only has 1 tag, when delete executed, may remain some tags created by v1.
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:"v0.2.0-alpha.1-309-g63a5556", GitCommit:"63a5556a", GitTreeState:"clean", BuildDate:"2024-10-23T02:42:55Z", GoVersion:"go1.23.0", Compiler:"gc", Platform:"linux/amd64"}
How reproducible:
Always
Steps to Reproduce:
1. mirror catalog package for v1: kind: ImageSetConfiguration apiVersion: mirror.openshift.io/v1alpha2 mirror: operators: - catalog: registry.redhat.io/redhat/redhat-operator-index:v4.15 packages: - name: sandboxed-containers-operator `oc-mirror -c config-catalog-v1.yaml docker://localhost:5000/catalog --dest-use-http` 2. mirror same package for v2 : kind: ImageSetConfiguration apiVersion: mirror.openshift.io/v2alpha1 mirror: operators: - catalog: registry.redhat.io/redhat/redhat-operator-index:v4.15 packages: - name: sandboxed-containers-operator `oc-mirror -c config-catalog-v2.yaml --workspace file://ws docker://localhost:5000/catalog --v2 --dest-tls-verify=false` 3. generate the delete image list with config : kind: DeleteImageSetConfiguration apiVersion: mirror.openshift.io/v2alpha1 delete: operators: - catalog: registry.redhat.io/redhat/redhat-operator-index:v4.15 packages: - name: sandboxed-containers-operator `oc-mirror delete -c config-d-catalog-v2.yaml --workspace file://ws docker://localhost:5000/catalog --v2 --dest-tls-verify=false --generate` 4. Execute the delete action: `oc-mirror delete --delete-yaml-file ws/working-dir/delete/delete-images.yaml docker://localhost:5000/catalog --v2 --dest-tls-verify=false `
Actual results:
1. v1 has more than 1 tags: [fedora@preserve-fedora-yinzhou ~]$ curl localhost:5000/v2/catalog/openshift4/ose-kube-rbac-proxy/tags/list |json_reformat % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 81 100 81 0 0 24382 0 --:--:-- --:--:-- --:--:-- 27000 { "name": "catalog/openshift4/ose-kube-rbac-proxy", "tags": [ "cb9a8d8a", "d07492b2" ] } 2. v2 only has 1 tag: [fedora@preserve-fedora-yinzhou ~]$ curl localhost:5000/v2/catalog/openshift4/ose-kube-rbac-proxy/tags/list |json_reformat % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 148 100 148 0 0 60408 0 --:--:-- --:--:-- --:--:-- 74000 { "name": "catalog/openshift4/ose-kube-rbac-proxy", "tags": [ "cb9a8d8a", "f6c37678f1eb3279e603f63d2a821b72394c52d25c2ed5058dc29d4caa15d504", "d07492b2" ] } 4. after delete , we could see still has tags remaining: [fedora@preserve-fedora-yinzhou ~]$ curl localhost:5000/v2/catalog/openshift4/ose-kube-rbac-proxy/tags/list |json_reformat % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 70 100 70 0 0 28056 0 --:--:-- --:--:-- --:--:-- 35000 { "name": "catalog/openshift4/ose-kube-rbac-proxy", "tags": [ "d07492b2" ] }
Expected results:
4. delete all the tags for the same image.
Additional info:
- clones
-
OCPBUGS-43729 v2 delete is not aware of storageConfig images mirrored by v1
- New
- is related to
-
CLID-205 Migration feature
- Code Review
- relates to
-
CLID-235 As oc-mirror user, I would like the migration between v1 and v2 to be smooth
- Testing