common

package
v1.30.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 18, 2024 License: Apache-2.0 Imports: 10 Imported by: 1

Documentation

Index

Constants

View Source
const (
	DefaultSystemdCgroupSlice = "/test.slice"
)

Variables

This section is empty.

Functions

func GetCgroupParent added in v1.29.0

func GetCgroupParent(ctx context.Context, c internalapi.RuntimeService) string

func WriteConfig

func WriteConfig(c *Config, filepath string) error

WriteConfig writes config to file an error if the file was unable to be written to.

Types

type Config

type Config struct {
	RuntimeEndpoint   string
	ImageEndpoint     string
	Timeout           int
	Debug             bool
	PullImageOnCreate bool
	DisablePullOnRun  bool
	// contains filtered or unexported fields
}

Config is the internal representation of the yaml that defines server configuration

func ReadConfig

func ReadConfig(filepath string) (*Config, error)

ReadConfig reads from a file with the given name and returns a config or an error if the file was unable to be parsed.

type ServerConfiguration

type ServerConfiguration struct {
	// RuntimeEndpoint is CRI server runtime endpoint
	RuntimeEndpoint string
	// ImageEndpoint is CRI server image endpoint
	ImageEndpoint string
	// Timeout  of connecting to server
	Timeout time.Duration
	// Debug enable debug output
	Debug bool
	// PullImageOnCreate enables also pulling an image for create requests
	PullImageOnCreate bool
	// DisablePullOnRun disables pulling an image for run requests
	DisablePullOnRun bool
}

ServerConfiguration is the config for connecting to and using a CRI server

func GetServerConfigFromFile

func GetServerConfigFromFile(configFileName, currentDir string) (*ServerConfiguration, error)

GetServerConfigFromFile returns the CRI server configuration from file

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL