Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed Network Config #2806

Merged
merged 14 commits into from
May 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 6 additions & 13 deletions OracleIdentityGovernance/samples/scripts/agentManagement.sh
Original file line number Diff line number Diff line change
Expand Up @@ -264,11 +264,11 @@ runAgent(){
then
if [ ! "$(docker ps -a -f "name=$AI" --format '{{.Names}}')" ]
then
echo "INFO: Starting new container using network mode $NETWORK"
echo "INFO: Starting new container."
if [ -f "$CONFDIR"/config.properties ]; then
docker run -d --network "$NETWORK" --env-file "$CONFDIR"/config.properties -v "$PV":/app --group-add "$groupId" --name "$AI" "$imageName"
docker run -d --env-file "$CONFDIR"/config.properties -v "$PV":/app --group-add "$groupId" --name "$AI" "$imageName"
else
docker run -d --network "$NETWORK" -v "$PV":/app --group-add "$groupId" --name "$AI" "$imageName"
docker run -d -v "$PV":/app --group-add "$groupId" --name "$AI" "$imageName"
fi
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 ;'
validateStatus=$(cat "$CONFDIR"/status.txt)
Expand Down Expand Up @@ -312,11 +312,11 @@ runAgent(){
then
if [ ! "$(podman ps -a -f "name=$AI" --format '{{.Names}}')" ]
then
echo "INFO: Starting new container using network mode $NETWORK"
echo "INFO: Starting new container."
if [ -f "$CONFDIR"/config.properties ]; then
podman run -d --network "$NETWORK" --env-file "$CONFDIR"/config.properties -v "$PV":/app --group-add "$groupId" --name "$AI" "$imageName"
podman run -d --env-file "$CONFDIR"/config.properties -v "$PV":/app --group-add "$groupId" --name "$AI" "$imageName"
else
podman run -d --network "$NETWORK" -v "$PV":/app --group-add "$groupId" --name "$AI" "$imageName"
podman run -d -v "$PV":/app --group-add "$groupId" --name "$AI" "$imageName"
fi

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 ;'
Expand Down Expand Up @@ -692,10 +692,6 @@ start()
if [ -f "$configOverride" ]; then
kill
fi
if [ "$NETWORK" = "" ];
then
NETWORK="host"
fi
runAgent
echo ""
agentVersion=$(grep agentVersion "$CONFDIR"/config.json | awk '{ print $2 }' | sed 's/,//g')
Expand Down Expand Up @@ -1034,8 +1030,6 @@ Help()
echo "-ap|--agentpackage No(Required in validate,install
and upgrade) \"\" Agent Package Path"
echo "-c|--config No - Path of the custom config property file"
echo "-n|--network No host Configuration to change the network type
of the container runtime."
echo "-pv|--volume Yes - Directory to persist agent data such as
configuration, wallet, logs, etc."

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