Documentation ¶
Index ¶
- Constants
- Variables
- func CreateContainer(ctx context.Context, sandbox vc.VCSandbox, ociSpec specs.Spec, ...) (vc.Process, error)
- func CreateRuntimeHooks(ctx context.Context, spec specs.Spec, cid, bundlePath string) error
- func CreateSandbox(ctx context.Context, vci vc.VC, ociSpec specs.Spec, ...) (_ vc.VCSandbox, _ vc.Process, err error)
- func EnterNetNS(networkID string, cb func() error) error
- func FileExists(path string) bool
- func GetDefaultConfigFilePaths() []string
- func GetDefaultHypervisorConfig() vc.HypervisorConfig
- func GetFileContents(file string) (string, error)
- func HandleFactory(ctx context.Context, vci vc.VC, runtimeConfig *oci.RuntimeConfig)
- func IsBlockDevice(filePath string) bool
- func LoadConfiguration(configPath string, ignoreLogging bool) (resolvedConfigPath string, config oci.RuntimeConfig, err error)
- func PostStartHooks(ctx context.Context, spec specs.Spec, cid, bundlePath string) error
- func PostStopHooks(ctx context.Context, spec specs.Spec, cid, bundlePath string) error
- func PreStartHooks(ctx context.Context, spec specs.Spec, cid, bundlePath string) error
- func ResolvePath(path string) (string, error)
- func SetConfigOptions(n, runtimeConfig, sysRuntimeConfig string)
- func SetEphemeralStorageType(ociSpec specs.Spec, disableGuestEmptyDir bool) specs.Spec
- func SetKernelParams(runtimeConfig *oci.RuntimeConfig) error
- func SetLogger(ctx context.Context, logger *logrus.Entry, level logrus.Level)
- func SetupNetworkNamespace(config *vc.NetworkConfig) error
- func VerifyContainerID(id string) error
- func WriteFile(filePath string, data string, fileMode os.FileMode) error
Constants ¶
const SYSLOGTAG = "kata"
SYSLOGTAG is for a consistently named syslog identifier
Variables ¶
var GetKernelParamsFunc = getKernelParams
GetKernelParamsFunc use a variable to allow tests to modify its value
Functions ¶
func CreateContainer ¶
func CreateContainer(ctx context.Context, sandbox vc.VCSandbox, ociSpec specs.Spec, rootFs vc.RootFs, containerID, bundlePath string, disableOutput bool, disableGuestEmptyDir bool) (vc.Process, error)
CreateContainer create a container
func CreateRuntimeHooks ¶
func CreateSandbox ¶
func CreateSandbox(ctx context.Context, vci vc.VC, ociSpec specs.Spec, runtimeConfig oci.RuntimeConfig, rootFs vc.RootFs, containerID, bundlePath string, disableOutput, systemdCgroup bool) (_ vc.VCSandbox, _ vc.Process, err error)
CreateSandbox create a sandbox container
func EnterNetNS ¶
EnterNetNS is free from any call to a go routine, and it calls into runtime.LockOSThread(), meaning it won't be executed in a different thread than the one expected by the caller.
func GetDefaultConfigFilePaths ¶
func GetDefaultConfigFilePaths() []string
GetDefaultConfigFilePaths returns a list of paths that will be considered as configuration files in priority order.
func GetDefaultHypervisorConfig ¶
func GetDefaultHypervisorConfig() vc.HypervisorConfig
func GetFileContents ¶
GetFileContents return the file contents as a string.
func HandleFactory ¶
HandleFactory set the factory
func IsBlockDevice ¶
IsBlockDevice returns true if the give path is a block device
func LoadConfiguration ¶
func LoadConfiguration(configPath string, ignoreLogging bool) (resolvedConfigPath string, config oci.RuntimeConfig, err error)
LoadConfiguration loads the configuration file and converts it into a runtime configuration.
If ignoreLogging is true, the system logger will not be initialised nor will this function make any log calls.
All paths are resolved fully meaning if this function does not return an error, all paths are valid at the time of the call.
func PostStartHooks ¶
PostStartHooks run the hooks just after start container
func PostStopHooks ¶
PostStopHooks run the hooks after stop container
func PreStartHooks ¶
PreStartHooks run the hooks before start container
func ResolvePath ¶
ResolvePath returns the fully resolved and expanded value of the specified path.
func SetConfigOptions ¶
func SetConfigOptions(n, runtimeConfig, sysRuntimeConfig string)
SetConfigOptions will override some of the defaults settings.
func SetEphemeralStorageType ¶
SetEphemeralStorageType sets the mount type to 'ephemeral' if the mount source path is provisioned by k8s for ephemeral storage. For the given pod ephemeral volume is created only once backed by tmpfs inside the VM. For successive containers of the same pod the already existing volume is reused.
func SetKernelParams ¶
func SetKernelParams(runtimeConfig *oci.RuntimeConfig) error
SetKernelParams adds the user-specified kernel parameters (from the configuration file) to the defaults so that the former take priority.
func SetupNetworkNamespace ¶
func SetupNetworkNamespace(config *vc.NetworkConfig) error
SetupNetworkNamespace create a network namespace
func VerifyContainerID ¶
VerifyContainerID checks if the specified container ID (or sandbox ID) is valid.
Types ¶
This section is empty.