Skip to content

Instantly share code, notes, and snippets.

@nickboldt
Created September 19, 2023 15:11
Show Gist options
  • Save nickboldt/3b109dacd16e629115f734819513846f to your computer and use it in GitHub Desktop.
Save nickboldt/3b109dacd16e629115f734819513846f to your computer and use it in GitHub Desktop.
Apply an Image Content Source Policy for registry.redhat.io --> quay.io for installing RH DH unreleased CI builds
TMPDIR=/tmp
for ICSP_URL in quay.io/rhdh/; do
ICSP_URL_PRE=${ICSP_URL%%/*}
# echo "[DEBUG] ${ICSP_URL_PRE}, ${ICSP_URL_PRE//./-}, ${ICSP_URL}"
echo "apiVersion: operator.openshift.io/v1alpha1
kind: ImageContentSourcePolicy
metadata:
name: ${ICSP_URL_PRE//./-}
spec:
repositoryDigestMirrors:
## 1. add mappings for Developer Hub bundle, operator, hub
- mirrors:
- ${ICSP_URL}rhdh-operator-bundle
source: registry.redhat.io/rhdh/rhdh-operator-bundle
- mirrors:
- ${ICSP_URL}rhdh-operator-bundle
source: registry.stage.redhat.io/rhdh/rhdh-operator-bundle
- mirrors:
- ${ICSP_URL}rhdh-operator-bundle
source: registry-proxy.engineering.redhat.com/rh-osbs/rhdh-rhdh-operator-bundle
- mirrors:
- ${ICSP_URL}rhdh-rhel9-operator
source: registry.redhat.io/rhdh/rhdh-rhel9-operator
- mirrors:
- ${ICSP_URL}rhdh-rhel9-operator
source: registry.stage.redhat.io/rhdh/rhdh-rhel9-operator
- mirrors:
- ${ICSP_URL}rhdh-rhel9-operator
source: registry-proxy.engineering.redhat.com/rh-osbs/rhdh-rhdh-rhel9-operator
- mirrors:
- ${ICSP_URL}rhdh-hub-rhel9
source: registry.redhat.io/rhdh/rhdh-hub-rhel9
- mirrors:
- ${ICSP_URL}rhdh-hub-rhel9
source: registry.stage.redhat.io/rhdh/rhdh-hub-rhel9
- mirrors:
- ${ICSP_URL}rhdh-hub-rhel9
source: registry-proxy.engineering.redhat.com/rh-osbs/rhdh-rhdh-hub-rhel9
## 2. general repo mappings
- mirrors:
- ${ICSP_URL_PRE}
source: registry.redhat.io
- mirrors:
- ${ICSP_URL_PRE}
source: registry.stage.redhat.io
- mirrors:
- ${ICSP_URL_PRE}
source: registry-proxy.engineering.redhat.com
### now add mappings to resolve internal references
- mirrors:
- registry.redhat.io
source: registry.stage.redhat.io
- mirrors:
- registry.stage.redhat.io
source: registry-proxy.engineering.redhat.com
- mirrors:
- registry.redhat.io
source: registry-proxy.engineering.redhat.com
" > $TMPDIR/ImageContentSourcePolicy_${ICSP_URL_PRE}.yml && oc apply -f $TMPDIR/ImageContentSourcePolicy_${ICSP_URL_PRE}.yml
done
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment