Skip to content

Commit

Permalink
Merge pull request containerd#7798 from calvin0327/fix-sdNotify
Browse files Browse the repository at this point in the history
fix sdNotify func when debug level
  • Loading branch information
fuweid authored Dec 12, 2022
2 parents 36641ea + f219f7d commit 5e51347
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions cmd/containerd/command/notify_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,13 @@ func notifyStopping(ctx context.Context) error {

func sdNotify(ctx context.Context, state string) error {
notified, err := sd.SdNotify(false, state)
log.G(ctx).
WithError(err).
WithField("notified", notified).
entry := log.G(ctx)
if err != nil {
entry = entry.WithError(err)
}
entry.WithField("notified", notified).
WithField("state", state).
Debug("sd notification")

return err
}

0 comments on commit 5e51347

Please sign in to comment.