Skip to content

Commit

Permalink
[patch] Compatibility fix for OCP 4.8 (#185)
Browse files Browse the repository at this point in the history
  • Loading branch information
durera authored Feb 17, 2023
1 parent 0307c06 commit 29aab0c
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 0 deletions.
26 changes: 26 additions & 0 deletions image/cli/mascli/functions/install
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,32 @@ function install() {
done

connect

# Check for OCP 4.8
export OCP_VERSION=$(oc get clusterversion version -o jsonpath="{.status.desired.version}")
if [[ "$OCP_VERSION" =~ ^4\.7\.* ]]; then
echo
echo_warning "Warning: OpenShift Container Platform v${OCP_VERSION} detected!"
echo_warning " - This version is now out of support by Red Hat and ${TEXT_UNDERLINE}not a supported platform for IBM Maximo Application Suite"
echo_warning " - The installation of IBM Maximo Application Suite may not proceed, you must upgrade to OCP v4.10 before installing MAS"
echo
echo_warning "For more information refer to the Red Hat OpenShift Container Platform Life Cycle Policy:"
echo " ${COLOR_CYAN}${TEXT_UNDERLINE}https://access.redhat.com/support/policy/updates/openshift/${COLOR_RESET}${TEXT_RESET}"
reset_colors
exit 1
elif [[ "$OCP_VERSION" =~ ^4\.8\.* ]]; then
echo
echo_warning "Warning: OpenShift Container Platform v${OCP_VERSION} detected!"
echo_warning " - This version is ${TEXT_UNDERLINE}now out of support by Red Hat"
echo_warning " - The installation of IBM Maximo Application Suite may proceed, but we strongly encourage you to upgrade to OCP v4.10 first"
echo
echo_warning "For more information refer to the Red Hat OpenShift Container Platform Life Cycle Policy:"
echo " ${COLOR_CYAN}${TEXT_UNDERLINE}https://access.redhat.com/support/policy/updates/openshift/${COLOR_RESET}${TEXT_RESET}"
reset_colors
echo
prompt_for_confirm "Continue anyway?" || exit 0
fi

detect_airgap
detect_sno
pipeline_install_operator
Expand Down
6 changes: 6 additions & 0 deletions image/cli/mascli/functions/pipeline_install_tasks
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ function pipeline_install_tasks() {
# Install the MAS Tekton definitions
cp $DIR/templates/ibm-mas-tekton.yaml $CONFIG_DIR/ibm-mas-tekton-$MAS_INSTANCE_ID.yaml
sed -e "s/cli:latest/cli:$VERSION/g" $DIR/templates/deployment.yaml > $CONFIG_DIR/deployment-$MAS_INSTANCE_ID.yaml

# Patch the tekton definitions to remove features not supported on OCP 4.8
if [[ "$OCP_VERSION" =~ ^4\.8\.* ]]; then
sed -i -e "s/onError: continue//g" $CONFIG_DIR/ibm-mas-tekton-$MAS_INSTANCE_ID.yaml
fi

CLI_IMAGE=quay.io/ibmmas/cli:$VERSION

if [[ "$AIRGAP_MODE" == "true" ]]; then
Expand Down
2 changes: 2 additions & 0 deletions image/cli/mascli/functions/update
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ EOM


function update_noninteractive() {
detect_airgap
while [[ $# -gt 0 ]]
do
key="$1"
Expand Down Expand Up @@ -50,6 +51,7 @@ function update_noninteractive() {

function update_interactive() {
connect
detect_airgap

echo
echo_h2 "Select IBM Maximo Operator Catalog Version"
Expand Down
2 changes: 2 additions & 0 deletions image/cli/mascli/functions/upgrade
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ EOM


function upgrade_noninteractive() {
detect_airgap
while [[ $# -gt 0 ]]
do
key="$1"
Expand Down Expand Up @@ -50,6 +51,7 @@ function upgrade_noninteractive() {

function upgrade_interactive() {
connect
detect_airgap

echo
echo_h2 "Select IBM Maximo Application Suite Upgrade"
Expand Down

0 comments on commit 29aab0c

Please sign in to comment.