-
Note: There is a race conditin in oc mirror during the mirror-to-disk process. If the index image changes, i.e a new one is published, between the time that oc mirror starts pulling images and the time oc mirror finishes, the resulting tar ball will be corrupted
-
HUGE WARNING: This process will has the index image listed by digest in your imageset-config.yaml. That works fine for mirror-to-disk run 1. When you want to update content you will want to do this again and get the digest of the latest version of the index image to put into the imageset-config.yaml. If that is NOT done, your imageset will become static.
podman pull registry.redhat.io/redhat/redhat-operator-index:v4.20export INDEX_IMAGE=$(echo "registry.redhat.io/redhat/redhat-operator-index@$(podman inspect registry.redhat.io/redhat/redhat-operator-index:v4.20 --format '{{.Digest}}')")cat <<EOF > imageset-config.yaml
kind: ImageSetConfiguration
apiVersion: mirror.openshift.io/v2alpha1
mirror:
platform:
channels:
- name: stable-4.20
type: ocp
minVersion: 4.20.18
maxVersion: 4.20.18
graph: true
operators:
- catalog: "${INDEX_IMAGE}"
packages:
- name: cincinnati-operator
channels:
- name: v1
EOFoc-mirror --v2 --config ./imageset-config.yaml file://${PWD}/mirror- Note: Make sure that when running disk-to-mirror that the imageset-config.yaml is the same as the mirror-to-disk and is using the catalog image digest value in both cases
oc-mirror -c ./imageset-config.yaml --from file:///home/<user>/oc-mirror/mirror1 docker://myregistry.com:6000 --v2