aboutsummaryrefslogtreecommitdiff
path: root/pkg/cgroups
diff options
context:
space:
mode:
authorGiuseppe Scrivano <gscrivan@redhat.com>2019-06-19 11:13:18 +0200
committerGiuseppe Scrivano <gscrivan@redhat.com>2019-06-26 13:17:02 +0200
commit72cf0c81e86435c1c8daed9bff183b20d6bc400c (patch)
tree09ce3687ec7977ac2a027639e376db3586979bc2 /pkg/cgroups
parentfa1869381301797295dece0aec12435fc902295b (diff)
downloadpodman-72cf0c81e86435c1c8daed9bff183b20d6bc400c.tar.gz
podman-72cf0c81e86435c1c8daed9bff183b20d6bc400c.tar.bz2
podman-72cf0c81e86435c1c8daed9bff183b20d6bc400c.zip
libpod: use pkg/cgroups instead of containerd/cgroups
use the new implementation for dealing with cgroups. Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Diffstat (limited to 'pkg/cgroups')
-rw-r--r--pkg/cgroups/blkio.go5
-rw-r--r--pkg/cgroups/cgroups.go1
-rw-r--r--pkg/cgroups/pids.go2
3 files changed, 4 insertions, 4 deletions
diff --git a/pkg/cgroups/blkio.go b/pkg/cgroups/blkio.go
index 8434703fd..8eb54abec 100644
--- a/pkg/cgroups/blkio.go
+++ b/pkg/cgroups/blkio.go
@@ -59,8 +59,6 @@ func (c *blkioHandler) Stat(ctr *CgroupControl, m *Metrics) error {
}
defer f.Close()
- var ioServiceBytesRecursive []BlkIOEntry
-
scanner := bufio.NewScanner(f)
for scanner.Scan() {
line := scanner.Text()
@@ -95,6 +93,9 @@ func (c *blkioHandler) Stat(ctr *CgroupControl, m *Metrics) error {
}
ioServiceBytesRecursive = append(ioServiceBytesRecursive, entry)
}
+ if err := scanner.Err(); err != nil {
+ return err
+ }
m.Blkio = BlkioMetrics{IoServiceBytesRecursive: ioServiceBytesRecursive}
return nil
}
diff --git a/pkg/cgroups/cgroups.go b/pkg/cgroups/cgroups.go
index 2a88c9db6..24dce71bd 100644
--- a/pkg/cgroups/cgroups.go
+++ b/pkg/cgroups/cgroups.go
@@ -6,7 +6,6 @@ import (
"os"
"path/filepath"
"strconv"
- "strings"
spec "github.com/opencontainers/runtime-spec/specs-go"
"github.com/pkg/errors"
diff --git a/pkg/cgroups/pids.go b/pkg/cgroups/pids.go
index f37ac7611..342b25d85 100644
--- a/pkg/cgroups/pids.go
+++ b/pkg/cgroups/pids.go
@@ -50,7 +50,7 @@ func (c *pidHandler) Stat(ctr *CgroupControl, m *Metrics) error {
return fmt.Errorf("function not implemented yet")
}
- PIDRoot := ctr.getCgroupv1Path(Pids)
+ PIDRoot = ctr.getCgroupv1Path(Pids)
current, err := readFileAsUint64(filepath.Join(PIDRoot, "pids.current"))
if err != nil {