Skip to content

Commit 4b5cc67

Browse files
authored
opm: fallback to upstream opm on failures (#1658)
fallback to statically linked latest upstream release of the opm binary if it cannot be downloaded from mirror.openshift.com ( https://mirror.openshift.com/pub/openshift-v4/x86_64/clients/ocp/4.16.0/opm-linux.tar.gz is still not there) or if the downloaded binary cannot be executed (on OCP 4.15 and greater is linked only for RHEL9, see: https://issues.redhat.com/browse/OPRUN-3221 ). Signed-off-by: Simone Tiraboschi <[email protected]>
1 parent 9d1a83c commit 4b5cc67

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

04_setup_ironic.sh

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,14 @@ if [ ! -z "${MIRROR_IMAGES}" ]; then
124124
_tmpfiles="$_tmpfiles $OLM_DIR"
125125

126126
pushd $OLM_DIR
127-
curl -O https://mirror.openshift.com/pub/openshift-v4/$(uname -m)/clients/ocp/${VERSION}.0/opm-linux.tar.gz
128-
tar xf opm-linux.tar.gz
127+
curl -O https://mirror.openshift.com/pub/openshift-v4/$(uname -m)/clients/ocp/${VERSION}.0/opm-linux.tar.gz && \
128+
tar xf opm-linux.tar.gz && \
129+
./opm version || \
130+
{
131+
echo "downloading latest upstream OPM client";
132+
curl -L "https://github.com/operator-framework/operator-registry/releases/latest/download/linux-$(uname -m | sed 's/aarch64/arm64/;s/x86_64/amd64/')-opm" -o opm;
133+
chmod +x opm; ./opm version;
134+
}
129135
sudo mv -f opm /usr/local/bin
130136
popd
131137

0 commit comments

Comments
 (0)