Skip to content

Commit 28ec016

Browse files
committed
pkg/domain/infra/abi/pods_stats.go: Remove Cgroups v1
Signed-off-by: Lokesh Mandvekar <[email protected]>
1 parent 8b802ae commit 28ec016

File tree

2 files changed

+0
-18
lines changed

2 files changed

+0
-18
lines changed

pkg/domain/infra/abi/pods_stats.go

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,11 @@ import (
1111
"github.com/containers/podman/v6/libpod"
1212
"github.com/containers/podman/v6/libpod/define"
1313
"github.com/containers/podman/v6/pkg/domain/entities"
14-
"github.com/containers/podman/v6/pkg/rootless"
1514
"github.com/docker/go-units"
16-
"go.podman.io/common/pkg/cgroups"
1715
)
1816

1917
// PodStats implements printing stats about pods.
2018
func (ic *ContainerEngine) PodStats(_ context.Context, namesOrIds []string, options entities.PodStatsOptions) ([]*entities.PodStatsReport, error) {
21-
// Cgroups v2 check for rootless.
22-
if rootless.IsRootless() {
23-
unified, err := cgroups.IsCgroup2UnifiedMode()
24-
if err != nil {
25-
return nil, err
26-
}
27-
if !unified {
28-
return nil, errors.New("pod stats is not supported in rootless mode without cgroups v2")
29-
}
30-
}
3119
// Get the (running) pods and convert them to the entities format.
3220
pods, err := getPodsByContext(options.All, options.Latest, namesOrIds, ic.Libpod)
3321
if err != nil {

pkg/specgen/generate/oci_linux.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ import (
1818
"github.com/opencontainers/runtime-tools/generate"
1919
"github.com/sirupsen/logrus"
2020
"go.podman.io/common/libimage"
21-
"go.podman.io/common/pkg/cgroups"
2221
"go.podman.io/common/pkg/config"
2322
"golang.org/x/sys/unix"
2423
)
@@ -65,11 +64,6 @@ func getCgroupPermissions(unmask []string) string {
6564
rw := "rw"
6665
cgroup := "/sys/fs/cgroup"
6766

68-
cgroupv2, _ := cgroups.IsCgroup2UnifiedMode()
69-
if !cgroupv2 {
70-
return ro
71-
}
72-
7367
if len(unmask) != 0 && unmask[0] == "ALL" {
7468
return rw
7569
}

0 commit comments

Comments
 (0)