From 8e76d18eff7ce47075134b870c37c2114fa4a8c5 Mon Sep 17 00:00:00 2001 From: fahedouch Date: Sun, 26 Apr 2020 19:12:01 +0200 Subject: [PATCH] remove if condition because it is handled by the sdNotify daemon func Signed-off-by: fahedouch lint code Signed-off-by: fahedouch --- cmd/containerd/command/notify_linux.go | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/cmd/containerd/command/notify_linux.go b/cmd/containerd/command/notify_linux.go index eafc401b6..be3d580f2 100644 --- a/cmd/containerd/command/notify_linux.go +++ b/cmd/containerd/command/notify_linux.go @@ -20,7 +20,6 @@ package command import ( "context" - "os" sd "github.com/coreos/go-systemd/v22/daemon" @@ -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 }