Navigation Menu

Skip to content

Commit

Permalink
Merge pull request #4213 from fahedouch/remove_unnecessary_condition
Browse files Browse the repository at this point in the history
remove if condition because it is handled by the sdNotify daemon func
  • Loading branch information
estesp committed Apr 27, 2020
2 parents 36952e9 + 8e76d18 commit 3f95bc5
Showing 1 changed file with 7 additions and 12 deletions.
19 changes: 7 additions & 12 deletions cmd/containerd/command/notify_linux.go
Expand Up @@ -20,7 +20,6 @@ package command

import (
"context"
"os"

sd "github.com/coreos/go-systemd/v22/daemon"

Expand All @@ -38,15 +37,11 @@ func notifyStopping(ctx context.Context) error {
}

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

return nil
notified, err := sd.SdNotify(false, state)
log.G(ctx).
WithError(err).
WithField("notified", notified).
WithField("state", state).
Debug("sd notification")
return err
}

0 comments on commit 3f95bc5

Please sign in to comment.