Review fixes
Signed-off-by: Justin Terry (VM) <juterry@microsoft.com>
This commit is contained in:
parent
2ddbb2db05
commit
beb1f432be
@ -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")
|
||||
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 {
|
||||
// default work dir and forward the bundle path on the cmdline.
|
||||
var bundlePath string
|
||||
if gruntime.GOOS != "windows" {
|
||||
bundlePath = b.bundle.Path
|
||||
}
|
||||
|
||||
|
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user