@@ -94,6 +94,32 @@ function mockWLS() {
94
94
echo " RUNNING:Y:N" > $STATEFILE
95
95
}
96
96
97
+ function waitUntilShutdown() {
98
+ #
99
+ # Wait forever. Kubernetes will monitor this pod via liveness and readyness probes.
100
+ #
101
+ if [ " ${SERVER_OUT_IN_POD_LOG} " == ' true' ] ; then
102
+ trace " Showing the server out file from ${SERVER_OUT_FILE} "
103
+ tail -F -n +0 ${SERVER_OUT_FILE} || exitOrLoop
104
+ else
105
+ trace " Wait indefinitely so that the Kubernetes pod does not exit and try to restart"
106
+ while true ; do sleep 60; done
107
+ fi
108
+ }
109
+
110
+ function mockWaitUntilShutdown() {
111
+ #
112
+ # Wait forever. Kubernetes will monitor this pod via liveness and readyness probes.
113
+ #
114
+ trace " Wait indefinitely so that the Kubernetes pod does not exit and try to restart"
115
+ while true ; do
116
+ if [ -e /u01/doShutdown ] ; then
117
+ exit 0
118
+ fi
119
+ sleep 5
120
+ done
121
+ }
122
+
97
123
# Define helper fn to copy sit cfg xml files from one dir to another
98
124
# $src_dir files are assumed to start with $fil_prefix and end with .xml
99
125
# Copied $tgt_dir files are stripped of their $fil_prefix
@@ -180,19 +206,8 @@ copySitCfg /weblogic-operator/introspector ${DOMAIN_HOME}/optconfig/wldf 'Sit-C
180
206
181
207
if [ " ${MOCK_WLS} " == ' true' ]; then
182
208
mockWLS
209
+ mockWaitUntilShutdown
183
210
else
184
211
startWLS
212
+ waitUntilShutdown
185
213
fi
186
-
187
- #
188
- # Wait forever. Kubernetes will monitor this pod via liveness and readyness probes.
189
- #
190
-
191
- if [ " ${MOCK_WLS} " != ' true' ] && [ " ${SERVER_OUT_IN_POD_LOG} " == ' true' ] ; then
192
- trace " Showing the server out file from ${SERVER_OUT_FILE} "
193
- tail -F -n +0 ${SERVER_OUT_FILE} || exitOrLoop
194
- else
195
- trace " Wait indefinitely so that the Kubernetes pod does not exit and try to restart"
196
- while true ; do sleep 60; done
197
- fi
198
-
0 commit comments