ibm-mas / cli

Maximo Application Suite command line interface
https://ibm-mas.github.io/cli/
Eclipse Public License 2.0
24 stars 18 forks source link

Mas update Kafka auto-detect with Storage Fusion B/R possible interference #758

Open rene-oromtz opened 9 months ago

rene-oromtz commented 9 months ago

Summary

IBM Storage Fusion B/R service installs AMQ Streams (Kafka) operator in version 2.4.0.0 provided by RedHat. While this is not the latest version, B/R service requires the operator to be in this version 2.4.x.

During MAS Core + Manage static update process, the installer will try to update Kafka, even when it's not part of Maximo. The catalog to be used is the one for January 2024.

4) Review Settings

 IBM Operator Catalog
 Current Catalog Version .................... v8-240130-amd64
 Updated Catalog Version .................... v8-240130-amd64

 Updates
 IBM Maximo Application Suite ............... Yes (all MAS instances)
 IBM Cloud Pak Foundational Services ........ Yes (ibm-common-services)
 Certificate Manager ........................ Yes (cert-manager)
 OpenShift Data Foundation ................. Yes
 IBM Db2 Universal Operator ................. Yes (db2u)
 MongoDb Community Edition .................. 5.0.23 to 5.0.23 (mongoce)
 Kafka (AMQ Streams) ........................ Yes (ibm-backup-restore)

Steps to reproduce

  1. Install Fusion 2.7.1 in cluster
  2. Install B/R service
  3. Install Maximo Core + Manage with Dec 2023 catalog
  4. Attempt upgrade to latest static catalog from January 2024

What is the current bug behavior?

Kafka auto-detect identifies an instance that does not belong to Maximo but will attempt to update.

What is the expected correct behavior?

If Maximo doesn't have a Kafka instance, the tool should not detect it

Possible fixes

A possible enhancement to this portion of code lines 274 to 293 from update function:

# Detect Kafka in cluster and set namespace
  # Auto-detect Kafka
  # ---------------------------------------------------------------------------
  if [ -z "$KAFKA_NAMESPACE" ]; then
    KAFKA_NAMESPACE=`oc get Kafka.kafka.strimzi.io -A -o jsonpath='{.items[0].metadata.namespace}' 2> /dev/null`
  fi

  if [ -z "$KAFKA_PROVIDER" ] && [ -n "$KAFKA_NAMESPACE" ]; then
    KAFKA_OPERATOR=`oc get subscription -n $KAFKA_NAMESPACE -o jsonpath='{.items[0].spec.name}' 2> /dev/null`
    if [ "$?" == "0" ]; then
      if [ "$KAFKA_OPERATOR" == "amq-streams" ]; then
        KAFKA_PROVIDER="redhat"
        KAFKA_PROVIDER_NAME="AMQ Streams) ........................"
      elif [ "$KAFKA_OPERATOR" == "strimzi-kafka-operator" ]; then
        KAFKA_PROVIDER="strimzi"
        KAFKA_PROVIDER_NAME="Strimzi) ............................"
      fi
    fi
  fi
}

The code will auto-detect the first Kafka instance, which in this case belongs to Fusion B/R. No Kafka instance was configured for Maximo. Kafka is only required by IoT, Monitor and is optional to Manage.

terenceq commented 6 months ago

We should investigate looking for another condition to understand if a Kafka instance is owned/used by MAS.