Commit a844523c authored by Bryan Moyles's avatar Bryan Moyles

Find most recent modified date for fluentd buffers recursively.

Due to updates in Fluent v0.14, the buffers directory modified date is no longer updated when files inside the directory are changed. Therefore we must find the most recent modified date recursively to fix liveness probe.
parent df363796
...@@ -61,14 +61,14 @@ spec: ...@@ -61,14 +61,14 @@ spec:
then then
exit 1; exit 1;
fi; fi;
LAST_MODIFIED_DATE=`stat /var/log/fluentd-buffers | grep Modify | sed -r "s/Modify: (.*)/\1/"`; touch -d "${STUCK_THRESHOLD_SECONDS} seconds ago" /tmp/marker-stuck;
LAST_MODIFIED_TIMESTAMP=`date -d "$LAST_MODIFIED_DATE" +%s`; if [[ -z "$(find /var/log/fluentd-buffers -type f -newer /tmp/marker-stuck -print -quit)" ]];
if [ `date +%s` -gt `expr $LAST_MODIFIED_TIMESTAMP + $STUCK_THRESHOLD_SECONDS` ];
then then
rm -rf /var/log/fluentd-buffers; rm -rf /var/log/fluentd-buffers;
exit 1; exit 1;
fi; fi;
if [ `date +%s` -gt `expr $LAST_MODIFIED_TIMESTAMP + $LIVENESS_THRESHOLD_SECONDS` ]; touch -d "${LIVENESS_THRESHOLD_SECONDS} seconds ago" /tmp/marker-liveness;
if [[ -z "$(find /var/log/fluentd-buffers -type f -newer /tmp/marker-liveness -print -quit)" ]];
then then
exit 1; exit 1;
fi; fi;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment