Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change how cleanup works for audit container #5491

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1013,8 +1013,9 @@ set -o nounset
set -o pipefail

function cleanup() {
kill -- -$$
pkill -P $$$
wait
exit
Copy link
Contributor

@Joseph-Goergen Joseph-Goergen Jan 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jared-hayes-dev Any particular reason why we explicitly exit here and along the other places?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe the wait below holds while the "background" (the tail) process is running.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • I think it is good practice to be explicit once we handle sigterm for the completion of the script
  • Although that wait does in fact handle that particular case (waiting for the last bg process) I think it is good practice to have a wait after killing all the child processes to ensure all bg processes are cleaned up before exiting.

}
trap cleanup SIGTERM

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,9 @@ spec:
set -o pipefail

function cleanup() {
kill -- -$$
pkill -P $$$
wait
exit
}
trap cleanup SIGTERM

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,9 @@ spec:
set -o pipefail

function cleanup() {
kill -- -$$
pkill -P $$$
wait
exit
}
trap cleanup SIGTERM

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,9 @@ spec:
set -o pipefail

function cleanup() {
kill -- -$$
pkill -P $$$
wait
exit
}
trap cleanup SIGTERM

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,9 @@ spec:
set -o pipefail

function cleanup() {
kill -- -$$
pkill -P $$$
wait
exit
}
trap cleanup SIGTERM

Expand Down