mirror of
https://github.com/gitpod-io/gitpod.git
synced 2025-12-08 17:36:30 +00:00
31 lines
676 B
Go
31 lines
676 B
Go
// Copyright (c) 2022 Gitpod GmbH. All rights reserved.
|
|
// Licensed under the GNU Affero General Public License (AGPL).
|
|
// See License.AGPL.txt in the project root for license information.
|
|
|
|
package integration
|
|
|
|
import (
|
|
agent "github.com/gitpod-io/gitpod/test/pkg/agent/workspace/api"
|
|
)
|
|
|
|
func IsCgroupV2(rsa *RpcClient) (bool, error) {
|
|
var resp agent.ExecResponse
|
|
err := rsa.Call("WorkspaceAgent.Exec", &agent.ExecRequest{
|
|
Dir: "/",
|
|
Command: "bash",
|
|
Args: []string{
|
|
"-c",
|
|
"test -f /sys/fs/cgroup/cgroup.controllers",
|
|
},
|
|
}, &resp)
|
|
if resp.ExitCode == 1 {
|
|
return false, nil
|
|
}
|
|
|
|
if err != nil {
|
|
return false, err
|
|
}
|
|
|
|
return resp.ExitCode == 0, nil
|
|
}
|