Description of problem:
When an ImageSetConfiguration contains duplicate top-level keys (e.g., two mirror: blocks), oc-mirror v2 parses the file without any error. The YAML parser (sigs.k8s.io/yaml) silently discards earlier keys and only applies the last one. This results in misleading success output while portions of the configuration are ignored. For example, a platform section can be dropped entirely if followed by another mirror: section defining operators.
Version-Release number of selected component (if applicable):
How reproducible:
Steps to Reproduce:
1. Create an imageset.yaml with two mirror: blocks: kind: ImageSetConfiguration apiVersion: mirror.openshift.io/v2alpha1 mirror: platform: channels: - name: stable-4.18 minVersion: 4.18.20 maxVersion: 4.18.21 graph: truemirror: operators: - catalog: registry.redhat.io/redhat/redhat-operator-index:v4.18 packages: - name: metallb additionalImages: - name: registry.redhat.io/ubi8/ubi:latest 2. Run oc mirror. 3. The command completes successfully. 4. Only the operators and additionalImages are mirrored; the platform images are silently ignored.
Actual results:
oc mirror runs successfully without warnings or errors. Only the last mirror: block is honored. Earlier sections (e.g., platform) are silently dropped.
Expected results:
oc mirror should fail fast with a clear validation error. Duplicate top-level keys in ImageSetConfiguration should be rejected. Schema validation should enforce correctness of the configuration before mirroring begins.
Additional info:
- is duplicated by
-
OCPBUGS-61995 oc-mirror v1 and v2 do not mirror multiple channels for the same operator
-
- Closed
-
- links to