Skip to content

Commit 448fb35

Browse files
Removed Network Config (#2806)
* removed -a flag to get container in running state * handled removing of the older image in post upgrade operation * added ServiceNow sample integration scripts * removed Service Now samples * removed Service Now samples * added config to provide network mode while starting an agent * removed network config --------- Co-authored-by: Rishi Agarwal <[email protected]>
1 parent 756646a commit 448fb35

File tree

1 file changed

+6
-13
lines changed

1 file changed

+6
-13
lines changed

OracleIdentityGovernance/samples/scripts/agentManagement.sh

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -264,11 +264,11 @@ runAgent(){
264264
then
265265
if [ ! "$(docker ps -a -f "name=$AI" --format '{{.Names}}')" ]
266266
then
267-
echo "INFO: Starting new container using network mode $NETWORK"
267+
echo "INFO: Starting new container."
268268
if [ -f "$CONFDIR"/config.properties ]; then
269-
docker run -d --network "$NETWORK" --env-file "$CONFDIR"/config.properties -v "$PV":/app --group-add "$groupId" --name "$AI" "$imageName"
269+
docker run -d --env-file "$CONFDIR"/config.properties -v "$PV":/app --group-add "$groupId" --name "$AI" "$imageName"
270270
else
271-
docker run -d --network "$NETWORK" -v "$PV":/app --group-add "$groupId" --name "$AI" "$imageName"
271+
docker run -d -v "$PV":/app --group-add "$groupId" --name "$AI" "$imageName"
272272
fi
273273
docker exec "$AI" /bin/bash -c 'agent ido validate --config /app/data/conf/config.json; if [[ "$?" != "0" ]] ; then echo VALIDATE_FAILED > /app/data/conf/status.txt; else echo VALIDATE_SUCCESS > /app/data/conf/status.txt; fi ;'
274274
validateStatus=$(cat "$CONFDIR"/status.txt)
@@ -312,11 +312,11 @@ runAgent(){
312312
then
313313
if [ ! "$(podman ps -a -f "name=$AI" --format '{{.Names}}')" ]
314314
then
315-
echo "INFO: Starting new container using network mode $NETWORK"
315+
echo "INFO: Starting new container."
316316
if [ -f "$CONFDIR"/config.properties ]; then
317-
podman run -d --network "$NETWORK" --env-file "$CONFDIR"/config.properties -v "$PV":/app --group-add "$groupId" --name "$AI" "$imageName"
317+
podman run -d --env-file "$CONFDIR"/config.properties -v "$PV":/app --group-add "$groupId" --name "$AI" "$imageName"
318318
else
319-
podman run -d --network "$NETWORK" -v "$PV":/app --group-add "$groupId" --name "$AI" "$imageName"
319+
podman run -d -v "$PV":/app --group-add "$groupId" --name "$AI" "$imageName"
320320
fi
321321

322322
podman exec "$AI" /bin/bash -c 'agent ido validate --config /app/data/conf/config.json; if [[ "$?" != "0" ]] ; then echo VALIDATE_FAILED > /app/data/conf/status.txt; else echo VALIDATE_SUCCESS > /app/data/conf/status.txt; fi ;'
@@ -692,10 +692,6 @@ start()
692692
if [ -f "$configOverride" ]; then
693693
kill
694694
fi
695-
if [ "$NETWORK" = "" ];
696-
then
697-
NETWORK="host"
698-
fi
699695
runAgent
700696
echo ""
701697
agentVersion=$(grep agentVersion "$CONFDIR"/config.json | awk '{ print $2 }' | sed 's/,//g')
@@ -1034,8 +1030,6 @@ Help()
10341030
echo "-ap|--agentpackage No(Required in validate,install
10351031
and upgrade) \"\" Agent Package Path"
10361032
echo "-c|--config No - Path of the custom config property file"
1037-
echo "-n|--network No host Configuration to change the network type
1038-
of the container runtime."
10391033
echo "-pv|--volume Yes - Directory to persist agent data such as
10401034
configuration, wallet, logs, etc."
10411035

@@ -1101,7 +1095,6 @@ while [ $# -gt 0 ]; do
11011095
"-pv"|"--volume" ) createDir "$1"; echo PV="$(cd "$(dirname "$1")" || exit 1; pwd -P)"/"$(basename "$1")" >> "$ENV_FILE_TEMP"; shift;;
11021096
"-h"|"--help" ) Help; exit 1;;
11031097
"-ai"|"--agentid" ) echo AI="$1" >> "$ENV_FILE_TEMP"; shift;;
1104-
"-n"|"--network" ) echo NETWORK="$1" >> "$ENV_FILE_TEMP"; shift;;
11051098
"-au"|"--autoupgrade" ) echo AU="$1" >> "$ENV_FILE_TEMP"; shift;;
11061099
"-ap"|"--agentpackage" ) echo AP="$(cd "$(dirname "$1")" || exit 1; pwd -P)"/"$(basename "$1")" >> "$ENV_FILE_TEMP"; shift;;
11071100
"-c"|"--config" ) configOverride=$(cd "$(dirname "$1")" || exit 1; pwd -P)/$(basename "$1"); shift;;

0 commit comments

Comments
 (0)