Skip to content
Open
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
2 changes: 2 additions & 0 deletions pkg/operator/staticpod/startupmonitor/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package startupmonitor
import (
"context"
"fmt"
"math"
"os"
"path/filepath"
"time"
Expand Down Expand Up @@ -201,6 +202,7 @@ func (o *Options) suicide(installerLock Locker) {
installerLock.Unlock()
klog.Info("Waiting for SIGTERM...")
for {
<-time.After(time.Duration(math.MaxInt64))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

A more idiomatic way is to do select {} and be done with it.

Having said that, the right approach IMO is to pass a context into suicide and block on <-ctx.Done(). You can just pass the signal context then and be done with it.

}
}

Expand Down