Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions modifications/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM registry-proxy.engineering.redhat.com/rh-osbs/openshift-ci-openshift-golang-builder-latest-rhel9:v4.20
FROM registry-proxy.engineering.redhat.com/rh-osbs/openshift-ci-openshift-golang-builder-latest-rhel9:v4.21
USER root

RUN dnf -y install python3 jq gettext python3-pyyaml \
Expand All @@ -12,9 +12,8 @@ RUN url="$(curl -Ls -o /dev/null -w %{url_effective} https://github.com/mikefara
&& chmod +x /usr/bin/yq

# Manually download and install OpenShift client (oc)
ENV OC_VERSION=4.19.0
ENV OC_VERSION=latest-4.20
ENV OC_URL=https://mirror.openshift.com/pub/openshift-v4/clients/ocp/${OC_VERSION}/openshift-client-linux.tar.gz

RUN wget ${OC_URL} -O openshift-client-linux.tar.gz && \
tar -zxvf openshift-client-linux.tar.gz && \
cp oc /usr/local/bin/ && \
Expand Down
22 changes: 20 additions & 2 deletions modifications/microshift-rebase
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ echo $PODMAN_BUILD_CMD
eval $PODMAN_BUILD_CMD
podman image prune -f # clean up unused images

# Run the podman container
# Run the podman container with retry logic
PODMAN_RUN_CMD="podman run --rm \
-e RELEASE_NAME \
-e MICROSHIFT_PAYLOAD_X86_64 \
Expand All @@ -49,4 +49,22 @@ PODMAN_RUN_CMD="podman run --rm \
microshift-rebase:$BREW_TAG \
$REBASE_CMD"
echo $PODMAN_RUN_CMD
eval $PODMAN_RUN_CMD

# Retry the podman run command up to 3 times on error
MAX_RETRIES=3
RETRY_COUNT=0
while [ $RETRY_COUNT -lt $MAX_RETRIES ]; do
if eval $PODMAN_RUN_CMD; then
echo "microshift rebase succeeded"
break
else
RETRY_COUNT=$((RETRY_COUNT + 1))
if [ $RETRY_COUNT -lt $MAX_RETRIES ]; then
echo "microshift rebase failed (attempt $RETRY_COUNT/$MAX_RETRIES). Retrying in 5 seconds..."
sleep 5
else
echo "microshift rebase failed after $MAX_RETRIES attempts"
exit 1
fi
fi
done