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

Add configuration of mongodb and rabbotmq hosts #255

Merged
merged 3 commits into from
Jul 19, 2024
Merged
Changes from 1 commit
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: 18 additions & 1 deletion update-config-map.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,24 @@ then
env
exit 1
fi

if [ -z "$MONGO_HOST" ];
then
MONGO_HOST='mongodb'
fi

if [ -z "$RABBIT_HOST" ];
jemaltahir marked this conversation as resolved.
Show resolved Hide resolved
then
RABBIT_HOST='rabbitmq'
fi

echo "Inputs:"
echo " CONFIG MAP NAME: $CONFIG_MAP_NAME"
echo " API SERVER: $APISERVER"
echo " APP CONFIG PATH: $APP_CONFIG_PATH"
echo " WES APP NAME: $WES_APP_NAME"
echo " MONGO HOST: $MONGO_HOST"
echo " RABBIT HOST: $RABBIT_HOST"

NAMESPACE=$(cat /var/run/secrets/kubernetes.io/serviceaccount/namespace)

Expand All @@ -29,7 +42,11 @@ echo "Current Kubernetes namespace: $NAMESPACE"; echo

echo " * Getting current default configuration"

APP_CONFIG=$(cat "$APP_CONFIG_PATH")
APP_CONFIG=$(yq --arg MONGO_HOST "$MONGO_HOST" \
--arg RABBIT_HOST "$RABBIT_HOST" \
'.db.host = $MONGO_HOST |
.jobs.host = $RABBIT_HOST' \
"$APP_CONFIG_PATH")
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue (bug_risk): Check for yq command availability.

Ensure that the script checks for the availability of the yq command before attempting to use it. This can prevent runtime errors if yq is not installed or not in the PATH.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, thanks for adding the check for the yq command availability! This will help prevent any runtime issues. If you encounter any further issues or need additional feedback, feel free to ask. Keep up the good work!


echo " * Getting current configMap"
curl -s \
Expand Down
Loading