mirror of
https://github.com/siderolabs/talos.git
synced 2025-08-08 07:37:06 +02:00
The new command `talosctl cgroups` fetches cgroups snapshot from the machine, parses it fully, enhances with additional information (e.g. resolves pod names), and presents a customizable view of cgroups configuration (e.g. limits) and current consumption. Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
42 lines
972 B
Go
42 lines
972 B
Go
// This Source Code Form is subject to the terms of the Mozilla Public
|
|
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
//go:build integration_cli
|
|
|
|
package cli
|
|
|
|
import (
|
|
"regexp"
|
|
|
|
"github.com/siderolabs/talos/internal/integration/base"
|
|
)
|
|
|
|
// CgroupsSuite verifies dmesg command.
|
|
type CgroupsSuite struct {
|
|
base.CLISuite
|
|
}
|
|
|
|
// SuiteName ...
|
|
func (suite *CgroupsSuite) SuiteName() string {
|
|
return "cli.CgroupsSuite"
|
|
}
|
|
|
|
// TestPresets verifies successful execution.
|
|
func (suite *CgroupsSuite) TestPresets() {
|
|
for _, preset := range []string{"cpu", "cpuset", "io", "memory", "process", "swap"} {
|
|
suite.Run(preset, func() {
|
|
suite.RunCLI(
|
|
[]string{
|
|
"cgroups", "--nodes", suite.RandomDiscoveredNodeInternalIP(),
|
|
"--preset", preset,
|
|
},
|
|
base.StdoutShouldMatch(regexp.MustCompile(`apid`)))
|
|
})
|
|
}
|
|
}
|
|
|
|
func init() {
|
|
allSuites = append(allSuites, new(CgroupsSuite))
|
|
}
|