We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 56b8dab commit 7b8ccc0Copy full SHA for 7b8ccc0
pkg/tracejob/job.go
@@ -296,6 +296,21 @@ func (t *TraceJobClient) CreateJob(nj TraceJob) (*batchv1.Job, error) {
296
SecurityContext: &apiv1.SecurityContext{
297
Privileged: boolPtr(true),
298
},
299
+ // We want to send SIGINT prior to the pod being killed, so we can print the map
300
+ // we will also wait for an arbitrary amount of time (10s) to give bpftrace time to
301
+ // process and summarize the data
302
+ // FIXME should this sleep be configurable? 10s is probably ample for most cases.
303
+ Lifecycle: &apiv1.Lifecycle{
304
+ PreStop: &apiv1.Handler{
305
+ Exec: &apiv1.ExecAction{
306
+ Command: []string{
307
+ "/bin/bash",
308
+ "-c",
309
+ "kill -SIGINT $(pidof bpftrace) && sleep 10",
310
+ },
311
312
313
314
315
316
RestartPolicy: "Never",
0 commit comments