Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
gitpod-io
GitHub Repository: gitpod-io/gitpod
Path: blob/main/test/pkg/integration/cgroup.go
2498 views
1
// Copyright (c) 2022 Gitpod GmbH. All rights reserved.
2
// Licensed under the GNU Affero General Public License (AGPL).
3
// See License.AGPL.txt in the project root for license information.
4
5
package integration
6
7
import (
8
agent "github.com/gitpod-io/gitpod/test/pkg/agent/workspace/api"
9
)
10
11
func IsCgroupV2(rsa *RpcClient) (bool, error) {
12
var resp agent.ExecResponse
13
err := rsa.Call("WorkspaceAgent.Exec", &agent.ExecRequest{
14
Dir: "/",
15
Command: "bash",
16
Args: []string{
17
"-c",
18
"test -f /sys/fs/cgroup/cgroup.controllers",
19
},
20
}, &resp)
21
if resp.ExitCode == 1 {
22
return false, nil
23
}
24
25
if err != nil {
26
return false, err
27
}
28
29
return resp.ExitCode == 0, nil
30
}
31
32