diff options
author | Šimon Lukašík <slukasik@redhat.com> | 2018-11-09 10:23:24 +0100 |
---|---|---|
committer | Šimon Lukašík <slukasik@redhat.com> | 2018-11-10 10:52:24 +0100 |
commit | 223d102ec79496a3a7e92d75b32eb9938f461c28 (patch) | |
tree | d948d0f8bc058ad122497524c5bdecd5740c2f5c /libpod/oci.go | |
parent | 9497b2254ce516d54649592c22a2338dcb2300eb (diff) | |
download | podman-223d102ec79496a3a7e92d75b32eb9938f461c28.tar.gz podman-223d102ec79496a3a7e92d75b32eb9938f461c28.tar.bz2 podman-223d102ec79496a3a7e92d75b32eb9938f461c28.zip |
Lint: Do not ignore errors from docker run command when selinux enabled
Redefining err by := operator within block makes this err variable block local.
Addressing lint:
libpod/oci.go:368:3:warning: ineffectual assignment to err (ineffassign)
Signed-off-by: Šimon Lukašík <slukasik@redhat.com>
Diffstat (limited to 'libpod/oci.go')
-rw-r--r-- | libpod/oci.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libpod/oci.go b/libpod/oci.go index 233bacfbb..71da830b5 100644 --- a/libpod/oci.go +++ b/libpod/oci.go @@ -350,7 +350,8 @@ func (r *OCIRuntime) createOCIContainer(ctr *Container, cgroupParent string, res // Set the label of the conmon process to be level :s0 // This will allow the container processes to talk to fifo-files // passed into the container by conmon - plabel, err := selinux.CurrentLabel() + var plabel string + plabel, err = selinux.CurrentLabel() if err != nil { childPipe.Close() return errors.Wrapf(err, "Failed to get current SELinux label") @@ -360,7 +361,7 @@ func (r *OCIRuntime) createOCIContainer(ctr *Container, cgroupParent string, res runtime.LockOSThread() if c["level"] != "s0" && c["level"] != "" { c["level"] = "s0" - if err := label.SetProcessLabel(c.Get()); err != nil { + if err = label.SetProcessLabel(c.Get()); err != nil { runtime.UnlockOSThread() return err } |