+
+ "${SDNC_BIN}"/configure_geo_cluster.sh $((node_index+member_offset)) "${node_list}"
+ else
+ printf "This is a local cluster\n"
+ i=0
+ node_list=""
+ # SERVICE_NAME and NAMESPACE are used to create cluster node names and are provided via Helm charts in OOM environment
+ if [ ! -z "$SERVICE_NAME" ] && [ ! -z "$NAMESPACE" ]; then
+ # Extract node name minus the index
+ # Example sdnr from "sdnr-2.logo.ost.das.r32.com"
+ node_name=$(echo "${fqdn}" | sed 's/-[0-9].*$//g')
+ while [ $i -lt "$SDNC_REPLICAS" ]; do
+ node_list="${node_list} ${node_name}-$i.${SERVICE_NAME}-cluster.${NAMESPACE}"
+ i=$(($i + 1))
+ done
+ "${ODL_HOME}"/bin/configure_cluster.sh $((node_index+1)) "${node_list}"
+ elif [ -z "$SERVICE_NAME" ] && [ -z "$NAMESPACE" ]; then
+ # Hostname is used in Standalone environment to create cluster node names
+ while [ $i -lt "$SDNC_REPLICAS" ]; do
+ #assemble node list by replacing node-index in hostname with "i"
+ node_name=$(echo "${fqdn}" | sed -r "s/-[0-9]/-$i/g")
+ node_list="${node_list} ${node_name}"
+ i=$(($i + 1))
+ done
+ "${ODL_HOME}"/bin/configure_cluster.sh $((node_index+1)) "${node_list}"
+ else
+ printf "Unhandled cluster scenario. Terminating the container\n"
+ printf "Any one of the below 2 conditions should be satisfied for successfully enabling cluster mode : \n"
+ printf "1. OOM Environment - Both SERVICE_NAME and NAMESPACE environment variables have to be set.\n"
+ printf "2. Docker (standalone) Environment - Neither of SERVICE_NAME and NAMESPACE have to be set.\n"
+ printf "Current configuration - SERVICE_NAME = $SERVICE_NAME NAMESPACE = $NAMESPACE\n"
+ exit $NOTOK
+ fi