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 5679147
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"
# This regex first matches for the first pattern to end with 4.xx, then scans again to only match
openshift_release="$(echo $JOB_NAME | grep -oP -e '^(?:.*?)(4\.[0-9]+)' | grep -oP -e '4\.[0-9]+').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 5679147

Please sign in to comment.