From 86733013cc0d60b93f5534b47326d2ad098e6d94 Mon Sep 17 00:00:00 2001 From: Kir Kolyshkin Date: Mon, 29 Nov 2021 19:48:03 -0800 Subject: [PATCH] notify_socket: setupSpec: drop ctx arg and return value Those were never used (ctx was added by the initial commit, and error was added by commit 25fd4a6757199). Signed-off-by: Kir Kolyshkin --- notify_socket.go | 3 +-- utils_linux.go | 4 +--- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/notify_socket.go b/notify_socket.go index 00ca672d3..76aa27ca5 100644 --- a/notify_socket.go +++ b/notify_socket.go @@ -43,7 +43,7 @@ func (s *notifySocket) Close() error { // If systemd is supporting sd_notify protocol, this function will add support // for sd_notify protocol from within the container. -func (s *notifySocket) setupSpec(context *cli.Context, spec *specs.Spec) error { +func (s *notifySocket) setupSpec(spec *specs.Spec) { pathInContainer := filepath.Join("/run/notify", path.Base(s.socketPath)) mount := specs.Mount{ Destination: path.Dir(pathInContainer), @@ -52,7 +52,6 @@ func (s *notifySocket) setupSpec(context *cli.Context, spec *specs.Spec) error { } spec.Mounts = append(spec.Mounts, mount) spec.Process.Env = append(spec.Process.Env, "NOTIFY_SOCKET="+pathInContainer) - return nil } func (s *notifySocket) bindSocket() error { diff --git a/utils_linux.go b/utils_linux.go index 4f0c192ba..a9badf20f 100644 --- a/utils_linux.go +++ b/utils_linux.go @@ -387,9 +387,7 @@ func startContainer(context *cli.Context, action CtAct, criuOpts *libcontainer.C notifySocket := newNotifySocket(context, os.Getenv("NOTIFY_SOCKET"), id) if notifySocket != nil { - if err := notifySocket.setupSpec(context, spec); err != nil { - return -1, err - } + notifySocket.setupSpec(spec) } container, err := createContainer(context, id, spec)