summaryrefslogtreecommitdiff
path: root/pkg/cgroups/cgroups.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-01-13 21:03:21 +0100
committerGitHub <noreply@github.com>2020-01-13 21:03:21 +0100
commit796ae87b1a3444557644944ddeb7cb37e303ef83 (patch)
tree192bd260c0b35519fe45ecbc91d7212251d82495 /pkg/cgroups/cgroups.go
parentc1d93666d4b175be29a0ba229ee0b94d50765888 (diff)
parent768c476ae3c1dbf37204f5769b43746358af899d (diff)
downloadpodman-796ae87b1a3444557644944ddeb7cb37e303ef83.tar.gz
podman-796ae87b1a3444557644944ddeb7cb37e303ef83.tar.bz2
podman-796ae87b1a3444557644944ddeb7cb37e303ef83.zip
Merge pull request #4850 from vrothberg/fix-linting
Fix linting
Diffstat (limited to 'pkg/cgroups/cgroups.go')
-rw-r--r--pkg/cgroups/cgroups.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/pkg/cgroups/cgroups.go b/pkg/cgroups/cgroups.go
index 9711e8120..6b28b2759 100644
--- a/pkg/cgroups/cgroups.go
+++ b/pkg/cgroups/cgroups.go
@@ -155,7 +155,7 @@ func (c *CgroupControl) getCgroupv1Path(name string) string {
}
// createCgroupv2Path creates the cgroupv2 path and enables all the available controllers
-func createCgroupv2Path(path string) (Err error) {
+func createCgroupv2Path(path string) (deferredError error) {
content, err := ioutil.ReadFile("/sys/fs/cgroup/cgroup.controllers")
if err != nil {
return errors.Wrapf(err, "read /sys/fs/cgroup/cgroup.controllers")
@@ -169,7 +169,7 @@ func createCgroupv2Path(path string) (Err error) {
if i == 0 {
res = fmt.Sprintf("+%s", c)
} else {
- res = res + fmt.Sprintf(" +%s", c)
+ res += fmt.Sprintf(" +%s", c)
}
}
resByte := []byte(res)
@@ -186,7 +186,7 @@ func createCgroupv2Path(path string) (Err error) {
} else {
// If the directory was created, be sure it is not left around on errors.
defer func() {
- if Err != nil {
+ if deferredError != nil {
os.Remove(current)
}
}()