Skip to content

Commit

Permalink
Compare OS release correctly
Browse files Browse the repository at this point in the history
OS releases need to be compared using the `os_releases` associative
array. This change fixes the incorrect comparison for mapping to the
appropriate Ceph release.

Fixes: canonical#162
Signed-off-by: Nicolas Bock <[email protected]>
  • Loading branch information
nicolasbock committed Dec 4, 2023
1 parent 7a732e1 commit 14d936a
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions common/helpers
Original file line number Diff line number Diff line change
Expand Up @@ -618,19 +618,18 @@ ost_release_autocorrect ()
# Requires APP_RELEASE_NAMES set by module generate-bundle.sh
get_app_release_name ()
{
local ubuntu_release="$1"
local ubuntu_release=$1
local release_name=
[ -n "$ubuntu_release" ] || return 0
readarray -t names_sorted_asc<<<"`echo ${!APP_RELEASE_NAMES[@]}| \
tr ' ' '\n'| sort`"
for name in ${names_sorted_asc[@]}; do
rel=${APP_RELEASE_NAMES[$name]}
if ! [[ "$rel" > "$ubuntu_release" ]]; then
release_name=$name
readarray -t names_sorted_asc<<<"$(echo ${!APP_RELEASE_NAMES[@]}| tr ' ' '\n'| sort)"
for name in "${names_sorted_asc[@]}"; do
rel=${APP_RELEASE_NAMES[${name}]}
if (( ${os_releases[${rel}]} <= ${os_releases[${ubuntu_release}]} )); then
release_name=${name}
fi
done
echo $release_name
echo "${release_name}"
return 0
}
Expand Down Expand Up @@ -839,4 +838,3 @@ is_hyperconverged ()
return 1
fi
}

0 comments on commit 14d936a

Please sign in to comment.