From beb1f432be15ac27d162a8b8835e272646e62f4b Mon Sep 17 00:00:00 2001 From: "Justin Terry (VM)" Date: Mon, 1 Oct 2018 09:02:19 -0700 Subject: [PATCH] Review fixes Signed-off-by: Justin Terry (VM) --- runtime/v2/binary.go | 11 +++++------ runtime/v2/shim/shim_windows.go | 4 ++-- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/runtime/v2/binary.go b/runtime/v2/binary.go index 034c266a3..41de0d3e0 100644 --- a/runtime/v2/binary.go +++ b/runtime/v2/binary.go @@ -110,13 +110,12 @@ func (b *binary) Start(ctx context.Context) (_ *shim, err error) { func (b *binary) Delete(ctx context.Context) (*runtime.Exit, error) { log.G(ctx).Info("cleaning up dead shim") + + // Windows cannot delete the current working directory while an + // executable is in use with it. For the cleanup case we invoke with the + // default work dir and forward the bundle path on the cmdline. var bundlePath string - if gruntime.GOOS == "windows" { - // Windows cannot delete the current working directory while an - // executable is in use with it. For the cleanup case we invoke with the - // deafult work dir and forward the bundle path on the cmdline. - bundlePath = "" - } else { + if gruntime.GOOS != "windows" { bundlePath = b.bundle.Path } diff --git a/runtime/v2/shim/shim_windows.go b/runtime/v2/shim/shim_windows.go index 7cfc6b012..b860e2dbd 100644 --- a/runtime/v2/shim/shim_windows.go +++ b/runtime/v2/shim/shim_windows.go @@ -129,7 +129,7 @@ func handleSignals(logger *logrus.Entry, signals chan os.Signal) error { // to reconnect to any shims. This means that the connection to the logger will // be severed but when containerd starts up it should reconnect and start // logging again. We abstract all of this logic behind what looks like a simple -// `io.Writer` that can reconnect in the liftime and buffers logs while +// `io.Writer` that can reconnect in the lifetime and buffers logs while // disconnected. type deferredShimWriteLogger struct { mu sync.Mutex @@ -193,7 +193,7 @@ func (dswl *deferredShimWriteLogger) Write(p []byte) (int, error) { } if dswl.connected { - // We have a connection. beginAccept would of drained the buffer so we just write our data to + // We have a connection. beginAccept would have drained the buffer so we just write our data to // the connection directly. written, err := dswl.c.Write(p) if err != nil {