Skip to content

Commit a21c0e3

Browse files
jupierceopenshift-cherrypick-robot
authored andcommitted
Allow test to tolerate running on minimal images minimal images provide microdnf instead of dnf/yum. ART attempts to insulate most images from this change by providing a thin wrapper around dnf/yum. However, microdnf fundamentally lacks some features. config-manager is an example that is currently unsupported. In the case of ubi minimal, it should not be necessary to use config-manager to install ubi repositories, so instead of assuming it is necessary, it is only attempted after an attempt to install skopeo fails. ART_DNF_WRAPPER_POLICY=skip is a subtle change which prevents the CI variant of cli image from trying to detect and install repositories suitable to provide access to RPMs not typically available to UBI.
1 parent 249c254 commit a21c0e3

2 files changed

Lines changed: 18 additions & 10 deletions

File tree

test/extended/testdata/bindata.go

Lines changed: 9 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/extended/testdata/signer-buildconfig.yaml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,17 @@ items:
1818
dockerfile: |
1919
FROM quay.io/openshift/origin-cli:latest
2020
WORKDIR /var/lib/origin
21+
ENV ART_DNF_WRAPPER_POLICY=skip
2122
RUN source /etc/os-release \
2223
&& rhel_major=${VERSION_ID%.*} \
23-
&& yum config-manager \
24-
--add-repo "https://cdn-ubi.redhat.com/content/public/ubi/dist/ubi${rhel_major}/${rhel_major}/\$basearch/baseos/os/" \
25-
--add-repo "https://cdn-ubi.redhat.com/content/public/ubi/dist/ubi${rhel_major}/${rhel_major}/\$basearch/appstream/os/"
26-
RUN yum install -y skopeo && \
27-
yum clean all && mkdir -p gnupg && chmod -R 0777 /var/lib/origin
24+
&& if ! yum install -y skopeo; then \
25+
echo "Unable to install skopeo; adding UBI repositories and retrying" && \
26+
yum config-manager \
27+
--add-repo "https://cdn-ubi.redhat.com/content/public/ubi/dist/ubi${rhel_major}/${rhel_major}/\$basearch/baseos/os/" \
28+
--add-repo "https://cdn-ubi.redhat.com/content/public/ubi/dist/ubi${rhel_major}/${rhel_major}/\$basearch/appstream/os/" && \
29+
yum install -y skopeo ; \
30+
fi
31+
RUN yum clean all && mkdir -p gnupg && chmod -R 0777 /var/lib/origin
2832
RUN echo $'%echo Generating openpgp key ...\n\
2933
Key-Type: RSA \n\
3034
Key-Length: 2048 \n\

0 commit comments

Comments
 (0)