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
6 changes: 3 additions & 3 deletions pkg/shim/shim.go
Original file line number Diff line number Diff line change
Expand Up @@ -250,8 +250,6 @@ func run(ctx context.Context, manager Manager, config Config) error {

ctx = namespaces.WithNamespace(ctx, namespaceFlag)
ctx = context.WithValue(ctx, OptsKey{}, Opts{BundlePath: bundlePath, Debug: debugFlag})
ctx, sd := shutdown.WithShutdown(ctx)
defer sd.Shutdown()

// Handle explicit actions
switch action {
Expand Down Expand Up @@ -303,7 +301,8 @@ func run(ctx context.Context, manager Manager, config Config) error {

return nil
}

ctx, sd := shutdown.WithShutdown(ctx)
defer sd.Shutdown()
if !config.NoSetupLogger {
ctx, err = setLogger(ctx, id)
if err != nil {
Expand Down Expand Up @@ -432,6 +431,7 @@ func run(ctx context.Context, manager Manager, config Config) error {

select {
case <-sd.Done():
log.G(ctx).Infof("shim shutdown with pid %d", os.Getpid())
return nil
case <-time.After(5 * time.Second):
return errors.New("shim shutdown timeout")
Expand Down