Skip to content

Commit 61a33ec

Browse files
committed
Merge branch 'trap-more' into 'main'
Trap signals in additional files See merge request weblogic-cloud/weblogic-kubernetes-operator!4937
2 parents 04d7d38 + 6a14f8d commit 61a33ec

File tree

2 files changed

+27
-2
lines changed

2 files changed

+27
-2
lines changed

operator/src/main/resources/scripts/initializeDomainHomeOnPV.sh

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
#!/bin/sh
2-
# Copyright (c) 2023, Oracle and/or its affiliates.
2+
# Copyright (c) 2023, 2025, Oracle and/or its affiliates.
3+
4+
cleanup() {
5+
trace "Suppressing signal to allow container to exit cleanly."
6+
exit 0
7+
}
8+
9+
trap cleanup SIGTERM SIGKILL
10+
11+
exitMessage() {
12+
trace "Exiting container for initializing domain home on PV of '${DOMAIN_UID}'."
13+
}
14+
15+
trap exitMessage EXIT
316

417
scriptDir="$( cd "$(dirname "$0")" > /dev/null 2>&1 ; pwd -P )"
518
if [ "${debug}" == "true" ]; then set -x; fi;

operator/src/main/resources/scripts/introspectDomain.sh

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
2-
# Copyright (c) 2018, 2024, Oracle and/or its affiliates.
2+
# Copyright (c) 2018, 2025, Oracle and/or its affiliates.
33
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
44

55
#
@@ -44,6 +44,18 @@
4444
# and introspectDomain.py (see these scripts to find out what else needs to be set).
4545
#
4646

47+
cleanup() {
48+
trace "Suppressing signal to allow container to exit cleanly."
49+
exit 0
50+
}
51+
52+
trap cleanup SIGTERM SIGKILL
53+
54+
exitMessage() {
55+
trace "Exiting container for introspection of '${DOMAIN_UID}'."
56+
}
57+
58+
trap exitMessage EXIT
4759

4860
SCRIPTPATH="$( cd "$(dirname "$0")" > /dev/null 2>&1 ; pwd -P )"
4961

0 commit comments

Comments
 (0)