Documentation ¶
Index ¶
- func BuildExecCommandString(cmd []string, env []corev1.EnvVar) (string, error)
- func BuildExportEnvCommand(env corev1.EnvVar) string
- func ExtractCPURequest(rl corev1.ResourceList) (uint, error)
- func ExtractMemoryRequest(rl corev1.ResourceList) (uint64, error)
- func GetContainerID(protocol, containerName string) string
- func SanitizeAppleCPUModelForK8sLabel(name string) string
- type FileCloner
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildExecCommandString ¶
BuildExecCommandString returns a shell command that executes the given command in a shell. The command is formatted as "sh -c $'COMMAND'" where COMMAND is the given command string. If the command has arguments, they are appended to the command string.
func BuildExportEnvCommand ¶
BuildExportEnvCommand returns a shell command that exports the given environment variable. The command is formatted as "export NAME=VALUE" where VALUE is escaped using heredoc syntax if it contains newlines.
func ExtractCPURequest ¶
func ExtractCPURequest(rl corev1.ResourceList) (uint, error)
func ExtractMemoryRequest ¶
func ExtractMemoryRequest(rl corev1.ResourceList) (uint64, error)
func GetContainerID ¶
GetContainerID returns a container ID based on the container name
func SanitizeAppleCPUModelForK8sLabel ¶
SanitizeAppleCPUModelForK8sLabel simplifies the Apple CPU model name to a valid k8s label value
Types ¶
type FileCloner ¶
type FileCloner struct { TempDir string FilenamePrefix string SysClonefileFunc func(src, dst string, flags int) error }
FileCloner is a utility to clone files.
func NewFileCloner ¶
func NewFileCloner() *FileCloner
NewFileCloner creates a new FileCloner with default values.