Merge "Sonar Fix: NotifyApprovals.java"
[aaf/authz.git] / auth / docker / agent.sh
index c330b1c..7340d30 100644 (file)
@@ -30,7 +30,7 @@ fi
 DOCKER=${DOCKER:=docker}
 CADI_VERSION=${CADI_VERSION:=2.1.10-SNAPSHOT}
 
-for V in VERSION DOCKER_REPOSITORY HOSTNAME AAF_FQDN AAF_FQDN_IP DEPLOY_FQI APP_FQDN APP_FQI VOLUME DRIVER LATITUDE LONGITUDE; do
+for V in VERSION DOCKER_REPOSITORY HOSTNAME CONTAINER_NS AAF_FQDN AAF_FQDN_IP DEPLOY_FQI APP_FQDN APP_FQI VOLUME DRIVER LATITUDE LONGITUDE; do
    if [ "$(grep $V ./aaf.props)" = "" ]; then
       unset DEF
       case $V in
@@ -48,16 +48,24 @@ for V in VERSION DOCKER_REPOSITORY HOSTNAME AAF_FQDN AAF_FQDN_IP DEPLOY_FQI APP_
                # Need AAF_FQDN's IP, because not might not be available in mini-container
                PROMPT="AAF FQDN IP"
                LOOKUP=$(host "${AAF_FQDN}" | grep "has address")
-               if [ -z ${LOOKUP} ]; then
-                    DEF= 
-                else 
+               if [ -n "${LOOKUP}" ]; then
                    DEF=$(echo ${LOOKUP} | tail -1 | cut -f 4 -d ' ')
                 fi
                 ;;
-         APP_FQI)    PROMPT="App's FQI";; 
-         APP_FQDN)   PROMPT="App's Root FQDN";; 
-         VOLUME)     PROMPT="APP's AAF Configuration Volume";;
+         APP_FQDN)   PROMPT="App's Root FQDN";;
+         APP_FQI)    PROMPT="App's FQI"
+                    if [[ "${APP_FQDN}" != *"."* ]]; then
+                      DEF="${APP_FQDN}@${APP_FQDN}.onap.org"
+                     fi
+                    ;; 
+         VOLUME)     PROMPT="APP's AAF Configuration Volume"
+                    if [[ "${APP_FQDN}" != *"."* ]]; then
+                      DEF="${APP_FQDN}_config"
+                    fi
+                ;;
          DRIVER)     PROMPT=$V;DEF=local;;
+         CONTAINER_NS)     
+                     PROMPT=$V;DEF=onap;;
         VERSION)    PROMPT="CADI Version";DEF=$CADI_VERSION;;
          LATITUDE|LONGITUDE) PROMPT="$V of Node";;
          *)          PROMPT=$V;;
@@ -111,6 +119,7 @@ function run_it() {
     --env APP_FQDN=${APP_FQDN} \
     --env LATITUDE=${LATITUDE} \
     --env LONGITUDE=${LONGITUDE} \
+    --env aaf_locator_container_ns=${CONTAINER_NS} \
     --name aaf-agent-$USER \
     "$PREFIX"onap/aaf/aaf_agent:$VERSION \
     bash -c "bash /opt/app/aaf_config/bin/agent.sh $PARAMS"