Skip to content

Commit 6bf10e5

Browse files
Exit on signals:
This makes the binary respect signals and shutdown properly. Signed-off-by: Jacob Weinstock <[email protected]>
1 parent 59694e8 commit 6bf10e5

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

images/hook-bootkit/main.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"context"
66
"encoding/base64"
77
"encoding/json"
8+
"errors"
89
"fmt"
910
"io"
1011
"os"
@@ -58,6 +59,10 @@ func main() {
5859
log.Info("starting BootKit: the tink-worker bootstrapper")
5960

6061
for {
62+
if errors.Is(ctx.Err(), context.Canceled) {
63+
log.Info("context cancellation received, exiting")
64+
return
65+
}
6166
if err := run(ctx, log); err != nil {
6267
log.Error(err, "bootstrapping tink-worker failed")
6368
log.Info("will retry in 5 seconds")

0 commit comments

Comments
 (0)