Skip to content

Commit 5d7358d

Browse files
committed
pkg/api/handlers/libpod/containers_stats.go: Remove Cgroups v1
Signed-off-by: Lokesh Mandvekar <[email protected]>
1 parent 30d07aa commit 5d7358d

File tree

1 file changed

+0
-12
lines changed

1 file changed

+0
-12
lines changed

pkg/api/handlers/libpod/containers_stats.go

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ package libpod
44

55
import (
66
"encoding/json"
7-
"errors"
87
"fmt"
98
"net/http"
109

@@ -13,25 +12,14 @@ import (
1312
api "github.com/containers/podman/v6/pkg/api/types"
1413
"github.com/containers/podman/v6/pkg/domain/entities"
1514
"github.com/containers/podman/v6/pkg/domain/infra/abi"
16-
"github.com/containers/podman/v6/pkg/rootless"
1715
"github.com/gorilla/schema"
1816
"github.com/sirupsen/logrus"
19-
"go.podman.io/common/pkg/cgroups"
2017
)
2118

2219
func StatsContainer(w http.ResponseWriter, r *http.Request) {
2320
runtime := r.Context().Value(api.RuntimeKey).(*libpod.Runtime)
2421
decoder := r.Context().Value(api.DecoderKey).(*schema.Decoder)
2522

26-
// Check if service is running rootless (cheap check)
27-
if rootless.IsRootless() {
28-
// if so, then verify cgroup v2 available (more expensive check)
29-
if isV2, _ := cgroups.IsCgroup2UnifiedMode(); !isV2 {
30-
utils.Error(w, http.StatusConflict, errors.New("container stats resource only available for cgroup v2"))
31-
return
32-
}
33-
}
34-
3523
query := struct {
3624
Containers []string `schema:"containers"`
3725
Stream bool `schema:"stream"`

0 commit comments

Comments
 (0)