package util
import "gvisor.dev/gvisor/runsc/cmd/util"
Package util groups a bunch of common helper functions used by commands.
Index ¶
- Variables
- func Errorf(format string, args ...any) subcommands.ExitStatus
- func Fatalf(format string, args ...any)
- func Infof(format string, args ...any)
- func IsPCIDeviceDirTPU(sysfsPath string, allowedDeviceIDs map[uint64]struct{}) bool
- func IsTPUDeviceValid(path string) (bool, error)
- type Writer
Variables ¶
ErrorLogger is where error messages should be written to. These messages are consumed by containerd and show up to users of command line tools, like docker/kubectl.
Functions ¶
func Errorf ¶
func Errorf(format string, args ...any) subcommands.ExitStatus
Errorf logs error to containerd log (--log), to stderr, and debug logs. It returns subcommands.ExitFailure for convenience with subcommand.Execute() methods:
return Errorf("Danger! Danger!")
func Fatalf ¶
Fatalf logs the same way as Errorf() does, plus *exits* the process.
func Infof ¶
Infof writes message to log and stdout.
func IsPCIDeviceDirTPU ¶
IsPCIDeviceDirTPU returns if the given PCI device sysfs path is a TPU device with one of the allowed device IDs.
func IsTPUDeviceValid ¶
IsTPUDeviceValid returns if the accelerator device is valid.
Types ¶
type Writer ¶
type Writer struct{}
Writer writes to log and stdout.
func (*Writer) Write ¶
Write implements io.Writer.
Source Files ¶
tpu.go util.go
- Version
- v0.0.0-20250605235530-a6711d1e1dc6 (latest)
- Published
- Jun 5, 2025
- Platform
- linux/amd64
- Imports
- 13 packages
- Last checked
- 4 hours ago –
Tools for package owners.