From 8e4e28c339a87aafd47205660d4f1900a963422d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Bompard?= Date: Wed, 28 Feb 2024 12:01:29 +0100 Subject: [PATCH] MM: try to fix the primary mirror scanning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Aurélien Bompard --- .../mirrormanager/templates/Dockerfile-builder-image | 3 +++ .../mirrormanager/templates/cron-primary-mirror.yml | 2 ++ .../mirrormanager/templates/primary-mirror-wrapper.sh | 5 +++++ 3 files changed, 10 insertions(+) diff --git a/roles/openshift-apps/mirrormanager/templates/Dockerfile-builder-image b/roles/openshift-apps/mirrormanager/templates/Dockerfile-builder-image index a45bbae40f..9160ecf09d 100644 --- a/roles/openshift-apps/mirrormanager/templates/Dockerfile-builder-image +++ b/roles/openshift-apps/mirrormanager/templates/Dockerfile-builder-image @@ -4,5 +4,8 @@ LABEL \ vendor="Fedora Infrastructure" \ license="MIT" USER root +# Add RPM-only modules +RUN dnf install -y python3-pyrpmmd +# Add Rust RUN dnf install -y cargo USER 1001 diff --git a/roles/openshift-apps/mirrormanager/templates/cron-primary-mirror.yml b/roles/openshift-apps/mirrormanager/templates/cron-primary-mirror.yml index 6d95070126..0b1d389338 100644 --- a/roles/openshift-apps/mirrormanager/templates/cron-primary-mirror.yml +++ b/roles/openshift-apps/mirrormanager/templates/cron-primary-mirror.yml @@ -52,4 +52,6 @@ spec: - name: mirror-archive persistentVolumeClaim: claimName: primary-mirror-archive + securityContext: + supplementalGroups: [1001280000] {% endfor %} diff --git a/roles/openshift-apps/mirrormanager/templates/primary-mirror-wrapper.sh b/roles/openshift-apps/mirrormanager/templates/primary-mirror-wrapper.sh index a8ea05aa6e..fbb81d4e56 100644 --- a/roles/openshift-apps/mirrormanager/templates/primary-mirror-wrapper.sh +++ b/roles/openshift-apps/mirrormanager/templates/primary-mirror-wrapper.sh @@ -56,6 +56,11 @@ if [ "${1}" == "centos" ]; then date exit 0 fi + if [ "${CODE}" -eq "000" ]; then + echo -n "CentOS primary mirror is unreachable. Skipping scan at " + date + exit 1 + fi FFTL="http://${CENTOS_PRIMARY}/9-stream/COMPOSE_ID" FILEDATE=`date +%s -d"$( curl -s --head ${FFTL} | awk 'BEGIN {FS=": "}/^Last-Modified/{print $2}' )"` FFTL_SIGS="http://${CENTOS_PRIMARY}/SIGs/9-stream/COMPOSE_ID"