// Copyright (c) 2022 Gitpod GmbH. All rights reserved.1// Licensed under the GNU Affero General Public License (AGPL).2// See License.AGPL.txt in the project root for license information.34package integration56import (7agent "github.com/gitpod-io/gitpod/test/pkg/agent/workspace/api"8)910func IsCgroupV2(rsa *RpcClient) (bool, error) {11var resp agent.ExecResponse12err := rsa.Call("WorkspaceAgent.Exec", &agent.ExecRequest{13Dir: "/",14Command: "bash",15Args: []string{16"-c",17"test -f /sys/fs/cgroup/cgroup.controllers",18},19}, &resp)20if resp.ExitCode == 1 {21return false, nil22}2324if err != nil {25return false, err26}2728return resp.ExitCode == 0, nil29}303132