Add -e to pre_stop hooks
This adds -e to the pre_stop scripts, so that they fail out if any of their commands fail. This is required, since it's the only way to communicate whether there is an issue during pre_hook execution. "The logs for a Hook handler are not exposed in Pod events. If a handler fails for some reason, it broadcasts an event." https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks As an example, this issue was discovered when "touch /tmp/stop" was failing silently due to a readOnlyRootFilesystem setting, resulting in pods that would not successfully Terminate until the grace period was exhausted. Change-Id: Ic9a228230d944530e31ed61f4239fd434cbb6187
This commit is contained in:
parent
46dffa8b12
commit
fcaacf94a3
|
@ -13,7 +13,7 @@
|
|||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
set -x
|
||||
set -ex
|
||||
|
||||
touch /tmp/stop
|
||||
sleep {{ .Values.anchor.period }}
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
set -x
|
||||
set -ex
|
||||
|
||||
touch /tmp/stop
|
||||
sleep {{ .Values.anchor.period }}
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
set -x
|
||||
set -ex
|
||||
|
||||
function cleanup_host {
|
||||
rm -f $MANIFEST_PATH
|
||||
|
|
|
@ -15,7 +15,7 @@ See the License for the specific language governing permissions and
|
|||
limitations under the License.
|
||||
*/}}
|
||||
|
||||
set -x
|
||||
set -ex
|
||||
|
||||
touch /tmp/stop
|
||||
sleep {{ .Values.conf.anchor.period }}
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
# limitations under the License.
|
||||
*/}}
|
||||
|
||||
set -x
|
||||
set -ex
|
||||
|
||||
touch /tmp/stop
|
||||
sleep {{ .Values.anchor.period }}
|
||||
|
|
Loading…
Reference in New Issue