Skip to content

Commit

Permalink
Don't default OpenShift version for butane config.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaypoulz committed Mar 26, 2024
1 parent f26f990 commit 75dc808
Showing 1 changed file with 13 additions and 1 deletion.
Expand Up @@ -7,11 +7,23 @@ set -o pipefail
node_role=${APPLY_NODE_ROLE:=worker}
log_path=${LOG_PATH:="/var/crash"}

openshift_release="4.11.0"
openshift_release=""
echo "Trying to extract release image version from RELEASE_IMAGE_LATEST=$RELEASE_IMAGE_LATEST"
if [[ $(echo $RELEASE_IMAGE_LATEST | grep -o -e "4\.[0-9]\+\.") ]]; then
openshift_release="$(echo $RELEASE_IMAGE_LATEST | grep -o -e '4\.[0-9]\+\.').0"
fi

if [[ -z "$openshift_release" ]]; then
echo "Unable to determine OpenShift release version from RELEASE_IMAGE_LATEST. Defaulting to JOB_NAME=$JOB_NAME"
# We use perl to do a non-greedy match of the first 4.{VER} and print only that match
openshift_release="$(echo $JOB_NAME | perl -pe 's|^(?:.*?)(4\.[0-9]+)(?:.*)$|\1|').0"
fi

if [[ -z "$openshift_release" ]]; then
echo "Unable to determine OpenShift release version from JOB_NAME. Skipping crash kernel configuration."
exit 0
fi

echo "Crash kernel set to ${CRASH_KERNEL_MEMORY}"

echo "Configuring kernel dumps on $node_role nodes"
Expand Down

0 comments on commit 75dc808

Please sign in to comment.