diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2019-07-23 19:26:20 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-07-23 19:26:20 +0200 |
commit | bb253af3fdc9928388bab1fb2063e7d0b79a5e4b (patch) | |
tree | 0e35bba61c97582527f9bd02cd48ad1b70e75c6f /libpod | |
parent | ce60c4d30c4acfa0c3ec9fc584c7eb88f84ac35f (diff) | |
parent | a793bccae6d568d3f30534d66bea3d5a1e8d9302 (diff) | |
download | podman-bb253af3fdc9928388bab1fb2063e7d0b79a5e4b.tar.gz podman-bb253af3fdc9928388bab1fb2063e7d0b79a5e4b.tar.bz2 podman-bb253af3fdc9928388bab1fb2063e7d0b79a5e4b.zip |
Merge pull request #3630 from baude/golangcilint5
golangci-lint cleanup
Diffstat (limited to 'libpod')
-rw-r--r-- | libpod/oci_attach_linux.go | 4 | ||||
-rw-r--r-- | libpod/oci_internal_linux.go | 11 |
2 files changed, 10 insertions, 5 deletions
diff --git a/libpod/oci_attach_linux.go b/libpod/oci_attach_linux.go index 7157ee2f7..22afa7416 100644 --- a/libpod/oci_attach_linux.go +++ b/libpod/oci_attach_linux.go @@ -188,7 +188,9 @@ func setupStdioChannels(streams *AttachStreams, conn *net.UnixConn, detachKeys [ var err error if streams.AttachInput { _, err = utils.CopyDetachable(conn, streams.InputStream, detachKeys) - conn.CloseWrite() + if connErr := conn.CloseWrite(); connErr != nil { + logrus.Errorf("unable to close conn: %q", connErr) + } } stdinDone <- err }() diff --git a/libpod/oci_internal_linux.go b/libpod/oci_internal_linux.go index 1d8654eca..0bcd021db 100644 --- a/libpod/oci_internal_linux.go +++ b/libpod/oci_internal_linux.go @@ -19,6 +19,7 @@ import ( "github.com/containers/libpod/libpod/define" "github.com/containers/libpod/pkg/cgroups" + "github.com/containers/libpod/pkg/errorhandling" "github.com/containers/libpod/pkg/lookup" "github.com/containers/libpod/pkg/util" "github.com/containers/libpod/utils" @@ -44,14 +45,14 @@ func (r *OCIRuntime) createOCIContainer(ctr *Container, restoreOptions *Containe if err != nil { return errors.Wrapf(err, "error creating socket pair") } - defer parentSyncPipe.Close() + defer errorhandling.CloseQuiet(parentSyncPipe) childStartPipe, parentStartPipe, err := newPipe() if err != nil { return errors.Wrapf(err, "error creating socket pair for start pipe") } - defer parentStartPipe.Close() + defer errorhandling.CloseQuiet(parentStartPipe) var ociLog string if logrus.GetLevel() != logrus.DebugLevel && r.supportsJSON { @@ -273,7 +274,7 @@ func (r *OCIRuntime) sharedConmonArgs(ctr *Container, cuuid, bundlePath, pidPath logDriver = JournaldLogging case JSONLogging: fallthrough - default: + default: //nolint-stylecheck // No case here should happen except JSONLogging, but keep this here in case the options are extended logrus.Errorf("%s logging specified but not supported. Choosing k8s-file logging instead", ctr.LogDriver()) fallthrough @@ -336,7 +337,9 @@ func startCommandGivenSelinux(cmd *exec.Cmd) error { err = cmd.Start() // Ignore error returned from SetProcessLabel("") call, // can't recover. - label.SetProcessLabel("") + if labelErr := label.SetProcessLabel(""); labelErr != nil { + logrus.Errorf("unable to set process label: %q", err) + } runtime.UnlockOSThread() return err } |