Test conditionally installing cri-o
Allows us to have cri-o brought in to an image if not supported
FROM fedora:29 AS build
COPY --from=registry.svc.ci.openshift.org/openshift/origin-v4.0:machine-os-content /srv/ /srv/
-RUN set -x && yum install -y ostree yum-utils selinux-policy-targeted && \
+RUN set -x && yum install -y ostree rpm-ostree yum-utils selinux-policy-targeted && \
commit=$( find /srv -name *.commit | sed -Ee 's|.*objects/(.+)/(.+)\.commit|\1\2|' | head -1 ) && \
mkdir /tmp/working && cd /tmp/working && \
+ rpm-ostree db list --repo /srv/repo $commit > /tmp/packages && \
PACKAGES=(openshift-hyperkube) && \
yumdownloader --enablerepo=built --destdir=/tmp/rpms "${PACKAGES[@]}" && \
+ if ! grep -q cri-o /tmp/packages; then yumdownloader --enablerepo=* --destdir=/tmp/rpms crio-o; fi && \
ls /tmp/rpms/ && (cd /tmp/rpms/ && ls ${PACKAGES[@]/%/*}) && \
- for i in $(find /tmp/rpms/ -name openshift-* -iname *.rpm); do echo "Extracting $i ..."; rpm2cpio $i | cpio -div; done && \
+ for i in $(find /tmp/rpms/ -name *.rpm); do echo "Extracting $i ..."; rpm2cpio $i | cpio -div; done && \
if [[ -d etc ]]; then mv etc usr/; fi && \
mkdir -p /tmp/tmprootfs/etc && \
ostree --repo=/srv/repo checkout -U $commit --subpath /usr/etc/selinux /tmp/tmprootfs/etc/selinux && \
