Review fixes

Signed-off-by: Justin Terry (VM) <juterry@microsoft.com>
This commit is contained in:
Justin Terry (VM) 2018-10-01 09:02:19 -07:00
parent 2ddbb2db05
commit beb1f432be
2 changed files with 7 additions and 8 deletions

View File

@ -110,13 +110,12 @@ func (b *binary) Start(ctx context.Context) (_ *shim, err error) {
func (b *binary) Delete(ctx context.Context) (*runtime.Exit, error) { func (b *binary) Delete(ctx context.Context) (*runtime.Exit, error) {
log.G(ctx).Info("cleaning up dead shim") log.G(ctx).Info("cleaning up dead shim")
var bundlePath string
if gruntime.GOOS == "windows" {
// Windows cannot delete the current working directory while an // Windows cannot delete the current working directory while an
// executable is in use with it. For the cleanup case we invoke with the // 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. // default work dir and forward the bundle path on the cmdline.
bundlePath = "" var bundlePath string
} else { if gruntime.GOOS != "windows" {
bundlePath = b.bundle.Path bundlePath = b.bundle.Path
} }

View File

@ -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 // 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 // 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 // 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. // disconnected.
type deferredShimWriteLogger struct { type deferredShimWriteLogger struct {
mu sync.Mutex mu sync.Mutex
@ -193,7 +193,7 @@ func (dswl *deferredShimWriteLogger) Write(p []byte) (int, error) {
} }
if dswl.connected { 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. // the connection directly.
written, err := dswl.c.Write(p) written, err := dswl.c.Write(p)
if err != nil { if err != nil {