Description of problem:
oc-mirror uploads the latest releases to the mirror registry along with the versions mentioned in the imageset configuration
Version-Release number of selected component (if applicable):
4.11.z
How reproducible:
100%
Steps to Reproduce:
1. Download oc-mirror binary ~~~ Client Version: version.Info{Major:"", Minor:"", GitVersion:"4.11.0-202302061916.p0.g334e515.assembly.stream-334e515", GitCommit:"334e51566ff7d547290d72fd84a6534a142ae36d", GitTreeState:"clean", BuildDate:"2023-02-07T07:46:56Z", GoVersion:"go1.18.7", Compiler:"gc", Platform:"linux/amd64"} ~~~ ~~~ oc version Client Version: 4.11.30 ~~~ 2. Create imageset-config.yaml ~~~ apiVersion: mirror.openshift.io/v1alpha2 kind: ImageSetConfiguration storageConfig: registry: imageURL: mirror.disharma.example.com:8443/oc-mirror/metadata-releases:v1.0 skipTLS: false mirror: platform: architectures: - amd64 channels: - name: stable-4.10 type: ocp minVersion: 4.10.37 maxversion: 4.10.37 shortestPath: true full: false - name: stable-4.11 type: ocp minVersion: 4.11.42 maxversion: 4.11.42 shortestPath: true full: false - name: stable-4.12 type: ocp minVersion: 4.12.19 maxversion: 4.12.19 shortestPath: true full: false ~~~ 3. It will upload all the release images of the versions mentioned in the imageset-config.yaml as well as the latest release available on that channel: ~~~ # egrep release-images oc-mirror-workspace/results-1690808866/mapping.txt quay.io/openshift-release-dev/ocp-release@sha256:340091aefa0bba06bbb99cc58cb1f2b73404c832f72b83c526b8e7677efbecef=mirror.disharma.example.com:8443/openshift/release-images:4.10.63-x86_64 quay.io/openshift-release-dev/ocp-release@sha256:c6771b12bd873c0e3e5fbc7afa600d92079de6534dcb52f09cb1d22ee49608a9=mirror.disharma.example.com:8443/openshift/release-images:4.11.45-x86_64 quay.io/openshift-release-dev/ocp-release@sha256:bd0603b261c362fb0589ac21444b7b9f4ecadb4cea9ef000164f1d3648116bce=mirror.disharma.example.com:8443/openshift/release-images:4.10.37-x86_64 quay.io/openshift-release-dev/ocp-release@sha256:518177a34452837920f1e77944f6afa08864537260c9f742b8c88b6157e4f901=mirror.disharma.example.com:8443/openshift/release-images:4.11.42-x86_64 quay.io/openshift-release-dev/ocp-release@sha256:41fd42cc8b9f86fc86cc8763dcf27e976299ff632a336d393b8e643bd8a5f967=mirror.disharma.example.com:8443/openshift/release-images:4.12.19-x86_64 ~~~
Actual results:
All the release images of the versions mentioned in the imageset-config.yaml as well as the latest release available on that channel are getting mirrored to the private registry
Expected results:
Only the versions mentioned in the imageset-config.yaml should be mirrored to the private registry
Additional info: