File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed
Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,13 @@ echo ${CURRENT_TS} > ${DIND_VOLUME_LAST_USED_TS_FILE}
2323export POD_NAME=${POD_NAME:- $(hostname)}
2424echo " ${POD_NAME} ${CURRENT_TS} " >> ${DIND_VOLUME_USED_BY_PODS_FILE}
2525
26+ write_termination_message () {
27+ local availableDiskSpaceKb=$( df ${DOCKERD_DATA_ROOT} | awk ' NR==2 {print $4}' )
28+ echo -e " \nAvailable disk space of $DOCKERD_DATA_ROOT at $( date) is: ${availableDiskSpaceKb} KiB"
29+
30+ echo " {\" availableDiskSpaceKb\" : ${availableDiskSpaceKb} }" > /dev/termination-log
31+ }
32+
2633sigterm_trap (){
2734 echo " ${1:- SIGTERM} received at $( date) "
2835 export SIGTERM=1
@@ -62,6 +69,11 @@ sigterm_trap(){
6269 time rm -rf ${DOCKERD_DATA_ROOT}
6370 fi
6471
72+ if [[ -n " ${WRITE_TERMINATION_MESSAGE} " ]]; then
73+ echo " Writing termination message"
74+ write_termination_message
75+ fi
76+
6577 echo " Running processes: "
6678 ps -ef
6779 echo " Exiting at $( date) "
Original file line number Diff line number Diff line change 1- version : 1.25.3
1+ version : 1.25.4
You can’t perform that action at this time.
0 commit comments