-
Notifications
You must be signed in to change notification settings - Fork 20
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
Fixes #14052: create a rudder server trigger_policy_generation command #199
Conversation
done | ||
|
||
# check if the API is available | ||
if netstat -lnt | grep -q "8080" > /dev/null |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe better to use the status API?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ha, i was wondering what was the state of the art for that
666753b
to
63f1700
Compare
Commit modified |
then | ||
echo "Successfully triggered a new policy generation" | ||
else | ||
echo "Failed to trigger a policy " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should return 1 in this case
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and display the message on stderr
63f1700
to
01147aa
Compare
Commit modified |
. "${BASEDIR}/../lib/api_call.sh" | ||
|
||
TOKEN="$(cat /var/rudder/run/api-token)" | ||
DISPLAY_COMMAND=false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is never used, it should always be the 5th arg of filtered_api_call, see api_call.sh
done | ||
|
||
# check if the API is available | ||
api_result=$(filtered_api_call "${API_URL}/api/system/status" "${TOKEN}" "GET" -f) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The request need an api version, most likely "latest", and add the DISPLAY_COMMAND arg
|
||
if [ ${api_code} -eq 0 ] | ||
then | ||
result=$(filtered_api_call "${API_URL}/api/system/update/policies" "${TOKEN}" "POST" -f) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The request need an api version, most likely "latest", and add the DISPLAY_COMMAND arg
01147aa
to
3a13261
Compare
Commit modified |
OK, merging this PR |
https://issues.rudder.io/issues/14052