Skip to content

Commit

Permalink
update maintained channel comparison
Browse files Browse the repository at this point in the history
Signed-off-by: YuChen <[email protected]>
  • Loading branch information
YCShen1010 committed Oct 4, 2024
1 parent 8a91a3f commit 0e9f5fb
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions cp3pt0-deployment/setup_tenant.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ YQ=yq
ENABLE_LICENSING=0
MINIMAL_RBAC_ENABLED=0
MINIMAL_RBAC=""
CHANNEL="v4.6"
CHANNEL="v4.10"
MAINTAINED_CHANNEL="v4.2"
SOURCE="opencloud-operators"
SOURCE_NS="openshift-marketplace"
Expand Down Expand Up @@ -266,9 +266,10 @@ function pre_req() {

# When Common Service channel info is less then maintained channel, update maintained channel for backward compatibility e.g., v4.1 and v4.0
# Otherwise, maintained channel is pinned at v4.2
local channel_numeric="${CHANNEL#v}"
local maintained_channel_numeric="${MAINTAINED_CHANNEL#v}"
if awk -v num="$channel_numeric" "BEGIN { exit !(num < $maintained_channel_numeric) }"; then
IFS='.' read -r channel_major channel_minor <<< "${CHANNEL#v}"
IFS='.' read -r maintained_major maintained_minor <<< "${MAINTAINED_CHANNEL#v}"

if (( channel_major < maintained_major )) || { (( channel_major == maintained_major )) && (( channel_minor < maintained_minor )); }; then
MAINTAINED_CHANNEL="$CHANNEL"
fi

Expand Down

0 comments on commit 0e9f5fb

Please sign in to comment.