mirror of
https://github.com/moby/moby.git
synced 2026-06-24 16:58:54 +00:00
These comments were added to enforce using the correct import path for
our packages ("github.com/docker/docker", not "github.com/moby/moby").
However, when working in go module mode (not GOPATH / vendor), they have
no effect, so their impact is limited.
Remove these imports in preparation of migrating our code to become an
actual go module.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
24 lines
744 B
Go
24 lines
744 B
Go
//go:build linux || freebsd
|
|
|
|
package logger
|
|
|
|
import (
|
|
"context"
|
|
"io"
|
|
|
|
"github.com/containerd/fifo"
|
|
"github.com/pkg/errors"
|
|
"golang.org/x/sys/unix"
|
|
)
|
|
|
|
func openPluginStream(a *pluginAdapter) (io.WriteCloser, error) {
|
|
// Make sure to also open with read (in addition to write) to avoid broken pipe errors on plugin failure.
|
|
// It is up to the plugin to keep track of pipes that it should re-attach to, however.
|
|
// If the plugin doesn't open for reads, then the container will block once the pipe is full.
|
|
f, err := fifo.OpenFifo(context.Background(), a.fifoPath, unix.O_RDWR|unix.O_CREAT|unix.O_NONBLOCK, 0o700)
|
|
if err != nil {
|
|
return nil, errors.Wrapf(err, "error creating i/o pipe for log plugin: %s", a.Name())
|
|
}
|
|
return f, nil
|
|
}
|