Skip to content

Instantly share code, notes, and snippets.

@cdoan1
Last active May 25, 2021 14:56
Show Gist options
  • Save cdoan1/fba0c5741f1c61024205faf8e7bb4fab to your computer and use it in GitHub Desktop.
Save cdoan1/fba0c5741f1c61024205faf8e7bb4fab to your computer and use it in GitHub Desktop.
rhacm-downstream-mirror-2

Start with the custom registry, which is an index image containing multiple release packages. Find the corresponding bundle image name associated to release 2.3.0.

podman run --name custom-registry --rm -p 50051:50051 \
quay.io/acm-d/acm-custom-registry:2.0.11-DOWNSTREAM-2021-05-21-21-35-58

grpcurl -plaintext  localhost:50051 api.Registry/ListBundles | jq '.bundlePath' | grep 2.3.0

Create and index image from the bundle.

opm index add --bundles quay.io/acm-d/acm-operator-bundle:v2.3.0-104 \
--tag f16-h11-000-1029p.rdu2.sl.redhat.com:5000/cdoan/acm-bundle-index-image:v2.3.0-104

Push the index image to repo.

podman push f16-h11-000-1029p.rdu2.sl.redhat.com:5000/cdoan/acm-bundle-index-image:v2.3.0-104 \
--authfile ./downloads/secrets/pull-secret-bundle.json --tls-verify=false

Mirror the index image for the 2.3.0 release.

oc adm catalog mirror f16-h11-000-1029p.rdu2.sl.redhat.com:5000/cdoan/acm-bundle-index-image:v2.3.0-104 \
f16-h11-000-1029p.rdu2.sl.redhat.com:5000 --manifests-only \
--insecure -a ./downloads/secrets/pull-secret-bundle.json

Now, verify that the list of images to mirror should be ~70 images.

cat manifests-acm-bundle-index-image-1621953643/mapping.txt | wc -lc

The index image can be loaded as a CatalogSource.

The ICSP should be similar to

apiVersion: operator.openshift.io/v1alpha1
kind: ImageContentSourcePolicy
metadata:
  name: acm-bundle-index-image
spec:
  repositoryDigestMirrors:
  - mirrors:
    - f16-h11-000-1029p.rdu2.sl.redhat.com:5000/rhacm2
    source: registry.redhat.io/rhacm2
  - mirrors:
    - f16-h11-000-1029p.rdu2.sl.redhat.com:5000/openshift4
    source: registry.redhat.io/openshift4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment