Skip to content

Commit

Permalink
fixup! Provide a way to support checking compatible version of mithri…
Browse files Browse the repository at this point in the history
…l and node binaries.
  • Loading branch information
TrevorBenson committed Aug 7, 2024
1 parent 6979967 commit 8dc9a6c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions scripts/cnode-helper-scripts/mithril.library
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ read_optional_ips_from_input() {
semantic_version_compare () {
if [[ "${1}" == "${2}" ]]
then
return 0
echo 0
fi
local IFS=.
local i semantic_version1=($1) semantic_version2=($2)
Expand All @@ -141,14 +141,14 @@ semantic_version_compare () {
do
if ((10#${semantic_version1[i]:=0} > 10#${semantic_version2[i]:=0}))
then
return 1
echo 1
fi
if ((10#${semantic_version1[i]} < 10#${semantic_version2[i]}))
then
return 2
echo 2
fi
done
return 0
echo 0
}

set_defaults() {
Expand Down Expand Up @@ -198,8 +198,8 @@ check_mithril_upgrade_safe() {
# Debug output
echo "DEBUG: MITHRIL_MINIMUM_NODE_VERSION=${MITHRIL_MINIMUM_NODE_VERSION}"

semantic_version_compare "${NODE_CURRENT_VERSION}" "${MITHRIL_MINIMUM_NODE_VERSION}"
if [[ $? -lt 2 ]]; then
RC=$(semantic_version_compare "${NODE_CURRENT_VERSION}" "${MITHRIL_MINIMUM_NODE_VERSION}")
if [[ "${RC}" -lt 2 ]]; then
# Node version is greater than or equal to the minimum required version for latest mithril release
# Set MITHRIL_UPGRADE_SAFE to Y to allow mithril upgrade by scripts
MITHRIL_UPGRADE_SAFE="Y"
Expand Down

0 comments on commit 8dc9a6c

Please sign in to comment.