File tree 2 files changed +13
-1
lines changed
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}
23
23
export POD_NAME=${POD_NAME:- $(hostname)}
24
24
echo " ${POD_NAME} ${CURRENT_TS} " >> ${DIND_VOLUME_USED_BY_PODS_FILE}
25
25
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
+
26
33
sigterm_trap (){
27
34
echo " ${1:- SIGTERM} received at $( date) "
28
35
export SIGTERM=1
@@ -62,6 +69,11 @@ sigterm_trap(){
62
69
time rm -rf ${DOCKERD_DATA_ROOT}
63
70
fi
64
71
72
+ if [[ -n " ${WRITE_TERMINATION_MESSAGE} " ]]; then
73
+ echo " Writing termination message"
74
+ write_termination_message
75
+ fi
76
+
65
77
echo " Running processes: "
66
78
ps -ef
67
79
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