Skip to content

Commit 78dbbcb

Browse files
committed
Use the context from the signal handler
This should help to avoid stopping issues
1 parent 1afc26f commit 78dbbcb

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

main.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,11 @@ func main() {
120120
panic(err)
121121
}
122122

123-
err = mgr.Start(context.Background())
123+
err = mgr.Start(ctx)
124+
if errors.Is(err, context.Canceled) {
125+
logger.V(0).Info("App stopped due to context cancellation")
126+
return
127+
}
124128
if err != nil {
125129
setupLog.V(0).Error(err, "problem running manager")
126130
panic(err)

0 commit comments

Comments
 (0)