diff --git a/ci-operator/jobs/infra-image-mirroring.yaml b/ci-operator/jobs/infra-image-mirroring.yaml index 946440795a169..53bf1ca6ec153 100644 --- a/ci-operator/jobs/infra-image-mirroring.yaml +++ b/ci-operator/jobs/infra-image-mirroring.yaml @@ -117,6 +117,7 @@ periodics: ci.openshift.io/role: image-mirroring name: periodic-image-mirroring-openshift-azure spec: + automountServiceAccountToken: true containers: - command: - /tp-entrypoint.sh @@ -127,18 +128,14 @@ periodics: value: mapping_openshift_azure - name: dry_run value: "false" - image: registry.ci.openshift.org/ci/skopeo:skopeo-stable-v1.15.0-jq + image: registry.ci.openshift.org/ci/image-mirror:oc-415 imagePullPolicy: Always name: "" resources: requests: cpu: 500m volumeMounts: - - mountPath: /home/mirror/.docker/pull-config.json - name: pull - readOnly: true - subPath: .dockerconfigjson - - mountPath: /home/mirror/.docker/push-config.json + - mountPath: /home/mirror/.docker/config.json name: push readOnly: true subPath: .dockerconfigjson @@ -148,9 +145,6 @@ periodics: - name: push secret: secretName: registry-push-credentials-quay.io-openshift-azure - - name: pull - secret: - secretName: registry-pull-credentials - configMap: name: image-mirror-mappings name: config @@ -541,26 +535,18 @@ periodics: ci.openshift.io/role: image-mirroring name: periodic-image-mirroring-openshift-kni spec: + automountServiceAccountToken: true containers: - - args: - - -c - - | - set -o errexit - failures=0 - for mapping in /etc/imagemirror/mapping_openshift-kni*; do - echo "Running: oc image mirror --keep-manifest-list -f=$mapping --skip-multiple-scopes" - if ! oc image mirror --keep-manifest-list -f="$mapping" --skip-multiple-scopes; then - echo "ERROR: Failed to mirror images from $mapping" - failures=$((failures+1)) - fi - done - exit $failures - command: - - /bin/bash + - command: + - /tp-entrypoint.sh env: - name: HOME value: /home/mirror - image: registry.ci.openshift.org/ocp/4.14:cli + - name: MAPPING_FILE_PREFIX + value: mapping_openshift-kni + - name: dry_run + value: "false" + image: registry.ci.openshift.org/ci/image-mirror:oc-415 imagePullPolicy: Always name: "" resources: @@ -642,27 +628,16 @@ periodics: spec: automountServiceAccountToken: true containers: - - args: - - -c - - | - set -euxo pipefail - cp ~/.docker/config.json /tmp/config.json - oc registry login --to /tmp/config.json - failures=0 - for mapping in /etc/imagemirror/mapping_ovirt_*; do - echo "Running: oc image mirror --keep-manifest-list -f=$mapping --skip-multiple-scopes" - if ! oc image mirror --keep-manifest-list -f="$mapping" --skip-multiple-scopes; then - echo "ERROR: Failed to mirror images from $mapping" - failures=$((failures+1)) - fi - done - exit $failures - command: - - /bin/bash + - command: + - /tp-entrypoint.sh env: - name: HOME value: /home/mirror - image: registry.ci.openshift.org/ocp/4.14:cli + - name: MAPPING_FILE_PREFIX + value: mapping_ovirt + - name: dry_run + value: "false" + image: registry.ci.openshift.org/ci/image-mirror:oc-415 imagePullPolicy: Always name: "" resources: @@ -693,27 +668,16 @@ periodics: spec: automountServiceAccountToken: true containers: - - args: - - -c - - | - set -o errexit - cp ~/.docker/config.json /tmp/config.json - oc registry login --to /tmp/config.json - failures=0 - for mapping in /etc/imagemirror/mapping_redhat-developer*; do - echo "Running: oc image mirror --keep-manifest-list -f=$mapping --skip-multiple-scopes" - if ! oc image mirror --keep-manifest-list -f="$mapping" --skip-multiple-scopes; then - echo "ERROR: Failed to mirror images from $mapping" - failures=$((failures+1)) - fi - done - exit $failures - command: - - /bin/bash + - command: + - /tp-entrypoint.sh env: - name: HOME value: /home/mirror - image: registry.ci.openshift.org/ocp/4.14:cli + - name: MAPPING_FILE_PREFIX + value: mapping_redhat-developer + - name: dry_run + value: "false" + image: registry.ci.openshift.org/ci/image-mirror:oc-415 imagePullPolicy: Always name: "" resources: @@ -892,26 +856,18 @@ periodics: report_template: '<@here> :red_jenkins_circle: Job *{{.Spec.Job}}* ended with *{{.Status.State}}*. <{{.Status.URL}}|View logs>' spec: + automountServiceAccountToken: true containers: - - args: - - -c - - | - set -o errexit - failures=0 - for mapping in /etc/imagemirror/mapping_edge_infrastructure*; do - echo "Running: oc image mirror --keep-manifest-list -f=$mapping --skip-multiple-scopes" - if ! oc image mirror --keep-manifest-list -f="$mapping" --skip-multiple-scopes; then - echo "ERROR: Failed to mirror images from $mapping" - failures=$((failures+1)) - fi - done - exit $failures - command: - - /bin/bash + - command: + - /tp-entrypoint.sh env: - name: HOME value: /home/mirror - image: registry.ci.openshift.org/ocp/4.14:cli + - name: MAPPING_FILE_PREFIX + value: mapping_edge_infrastructure + - name: dry_run + value: "false" + image: registry.ci.openshift.org/ci/image-mirror:oc-415 imagePullPolicy: Always name: "" resources: @@ -942,27 +898,16 @@ periodics: spec: automountServiceAccountToken: true containers: - - args: - - -c - - | - set -o errexit - cp ~/.docker/config.json /tmp/config.json - oc registry login --to /tmp/config.json - failures=0 - for mapping in /etc/imagemirror/mapping_hypershift*; do - echo "Running: oc image mirror --keep-manifest-list -f=$mapping --skip-multiple-scopes" - if ! oc image mirror --keep-manifest-list -a /tmp/config.json -f="$mapping" --skip-multiple-scopes; then - echo "ERROR: Failed to mirror images from $mapping" - failures=$((failures+1)) - fi - done - exit $failures - command: - - /bin/bash + - command: + - /tp-entrypoint.sh env: - name: HOME value: /home/mirror - image: registry.ci.openshift.org/ocp/4.14:cli + - name: MAPPING_FILE_PREFIX + value: mapping_hypershift + - name: dry_run + value: "false" + image: registry.ci.openshift.org/ci/image-mirror:oc-415 imagePullPolicy: Always name: "" resources: @@ -991,26 +936,18 @@ periodics: ci.openshift.io/role: image-mirroring name: periodic-image-mirroring-konveyor spec: + automountServiceAccountToken: true containers: - - args: - - -c - - | - set -o errexit - failures=0 - for mapping in /etc/imagemirror/mapping_konveyor*; do - echo "Running: oc image mirror --keep-manifest-list -f=$mapping --skip-multiple-scopes" - if ! oc image mirror --keep-manifest-list -f="$mapping" --skip-multiple-scopes; then - echo "ERROR: Failed to mirror images from $mapping" - failures=$((failures+1)) - fi - done - exit $failures - command: - - /bin/bash + - command: + - /tp-entrypoint.sh env: - name: HOME value: /home/mirror - image: registry.ci.openshift.org/ocp/4.14:cli + - name: MAPPING_FILE_PREFIX + value: mapping_konveyor + - name: dry_run + value: "false" + image: registry.ci.openshift.org/ci/image-mirror:oc-415 imagePullPolicy: Always name: "" resources: @@ -1039,36 +976,18 @@ periodics: ci.openshift.io/role: image-mirroring name: periodic-image-mirroring-node-observability-operator spec: + automountServiceAccountToken: true containers: - - args: - - -c - - | - set -o errexit - failures=0 - for mapping in /etc/imagemirror/mapping_node_observability_operator*; do - ciimage=$(cat ${mapping} | cut -d ' ' -f1) - quayimage=$(cat ${mapping} | cut -d ' ' -f2) - digest=$(oc image info ${ciimage} | grep 'Digest:' | tr -d ' ' | cut -d ':' -f2-) - shorttag=$(echo ${digest} | cut -d: -f2 | grep -oP '^.{12}') - quayimageshort=${quayimage/:*/:${shorttag}} - echo "Running: oc image mirror --keep-manifest-list ${ciimage}=${quayimageshort} --skip-multiple-scopes" - if ! oc image mirror --keep-manifest-list ${ciimage}=${quayimageshort} --skip-multiple-scopes; then - echo "ERROR: Failed to mirror images from $mapping to ${quayimageshort}" - failures=$((failures+1)) - fi - echo "Running: oc image mirror --keep-manifest-list -f=$mapping --skip-multiple-scopes" - if ! oc image mirror --keep-manifest-list -f="$mapping" --skip-multiple-scopes; then - echo "ERROR: Failed to mirror images from $mapping" - failures=$((failures+1)) - fi - done - exit $failures - command: - - /bin/bash + - command: + - /tp-entrypoint.sh env: - name: HOME value: /home/mirror - image: registry.ci.openshift.org/ocp/4.14:cli + - name: MAPPING_FILE_PREFIX + value: mapping_node_observability_operator + - name: dry_run + value: "false" + image: registry.ci.openshift.org/ci/image-mirror:oc-415 imagePullPolicy: Always name: "" resources: @@ -1097,36 +1016,18 @@ periodics: ci.openshift.io/role: image-mirroring name: periodic-image-mirroring-external-dns-operator spec: + automountServiceAccountToken: true containers: - - args: - - -c - - | - set -o errexit - failures=0 - for mapping in /etc/imagemirror/mapping_external_dns_operator*; do - ciimage=$(cat ${mapping} | cut -d ' ' -f1) - quayimage=$(cat ${mapping} | cut -d ' ' -f2) - digest=$(oc image info ${ciimage} | grep 'Digest:' | tr -d ' ' | cut -d ':' -f2-) - shorttag=$(echo ${digest} | cut -d: -f2 | grep -oP '^.{12}') - quayimageshort=${quayimage/:*/:${shorttag}} - echo "Running: oc image mirror --keep-manifest-list ${ciimage}=${quayimageshort} --skip-multiple-scopes" - if ! oc image mirror --keep-manifest-list ${ciimage}=${quayimageshort} --skip-multiple-scopes; then - echo "ERROR: Failed to mirror images from $mapping to ${quayimageshort}" - failures=$((failures+1)) - fi - echo "Running: oc image mirror --keep-manifest-list -f=$mapping --skip-multiple-scopes" - if ! oc image mirror --keep-manifest-list -f="$mapping" --skip-multiple-scopes; then - echo "ERROR: Failed to mirror images from $mapping" - failures=$((failures+1)) - fi - done - exit $failures - command: - - /bin/bash + - command: + - /tp-entrypoint.sh env: - name: HOME value: /home/mirror - image: registry.ci.openshift.org/ocp/4.14:cli + - name: MAPPING_FILE_PREFIX + value: mapping_external_dns_operator + - name: dry_run + value: "false" + image: registry.ci.openshift.org/ci/image-mirror:oc-415 imagePullPolicy: Always name: "" resources: @@ -1155,36 +1056,18 @@ periodics: ci.openshift.io/role: image-mirroring name: periodic-image-mirroring-aws-load-balancer-operator spec: + automountServiceAccountToken: true containers: - - args: - - -c - - | - set -o errexit - failures=0 - for mapping in /etc/imagemirror/mapping_aws_load_balancer_operator*; do - ciimage=$(cat ${mapping} | cut -d ' ' -f1) - quayimage=$(cat ${mapping} | cut -d ' ' -f2) - digest=$(oc image info ${ciimage} | grep 'Digest:' | tr -d ' ' | cut -d ':' -f2-) - shorttag=$(echo ${digest} | cut -d: -f2 | grep -oP '^.{12}') - quayimageshort=${quayimage/:*/:${shorttag}} - echo "Running: oc image mirror --keep-manifest-list ${ciimage}=${quayimageshort} --skip-multiple-scopes" - if ! oc image mirror --keep-manifest-list ${ciimage}=${quayimageshort} --skip-multiple-scopes; then - echo "ERROR: Failed to mirror images from $mapping to ${quayimageshort}" - failures=$((failures+1)) - fi - echo "Running: oc image mirror --keep-manifest-list -f=$mapping --skip-multiple-scopes" - if ! oc image mirror --keep-manifest-list -f="$mapping" --skip-multiple-scopes; then - echo "ERROR: Failed to mirror images from $mapping" - failures=$((failures+1)) - fi - done - exit $failures - command: - - /bin/bash + - command: + - /tp-entrypoint.sh env: - name: HOME value: /home/mirror - image: registry.ci.openshift.org/ocp/4.14:cli + - name: MAPPING_FILE_PREFIX + value: mapping_aws_load_balancer_operator + - name: dry_run + value: "false" + image: registry.ci.openshift.org/ci/image-mirror:oc-415 imagePullPolicy: Always name: "" resources: @@ -1263,26 +1146,18 @@ periodics: report_template: Job *{{.Spec.Job}}* ended with *{{.Status.State}}*. <{{.Status.URL}}|View logs> spec: + automountServiceAccountToken: true containers: - - args: - - -c - - | - set -o errexit - failures=0 - for mapping in /etc/imagemirror/mapping_osa*; do - echo "Running: oc image mirror --keep-manifest-list -f=$mapping --skip-multiple-scopes" - if ! oc image mirror --keep-manifest-list -f="$mapping" --skip-multiple-scopes; then - echo "ERROR: Failed to mirror images from $mapping" - failures=$((failures+1)) - fi - done - exit $failures - command: - - /bin/bash + - command: + - /tp-entrypoint.sh env: - name: HOME value: /home/mirror - image: registry.ci.openshift.org/ocp/4.14:cli + - name: MAPPING_FILE_PREFIX + value: mapping_osa + - name: dry_run + value: "false" + image: registry.ci.openshift.org/ci/image-mirror:oc-415 imagePullPolicy: Always name: "" resources: @@ -1311,26 +1186,18 @@ periodics: ci.openshift.io/role: image-mirroring name: periodic-image-mirroring-lightspeed-service spec: + automountServiceAccountToken: true containers: - - args: - - -c - - | - set -o errexit - failures=0 - for mapping in /etc/imagemirror/mapping_lightspeed_service*; do - echo "Running: oc image mirror --keep-manifest-list -f=$mapping --skip-multiple-scopes" - if ! oc image mirror --keep-manifest-list -f="$mapping" --skip-multiple-scopes; then - echo "ERROR: Failed to mirror images from $mapping" - failures=$((failures+1)) - fi - done - exit $failures - command: - - /bin/bash + - command: + - /tp-entrypoint.sh env: - name: HOME value: /home/mirror - image: registry.ci.openshift.org/ocp/4.14:cli + - name: MAPPING_FILE_PREFIX + value: mapping_lightspeed_service + - name: dry_run + value: "false" + image: registry.ci.openshift.org/ci/image-mirror:oc-415 imagePullPolicy: Always name: "" resources: