generate

package
v4.8.1 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2023 License: Apache-2.0 Imports: 49 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BlockAccessToKernelFilesystems

func BlockAccessToKernelFilesystems(privileged, pidModeIsHost bool, mask, unmask []string, g *generate.Generator)

func CheckName added in v4.3.0

func CheckName(rt *libpod.Runtime, n string, kind bool) string

Check name looks for existing containers/pods with the same name, and modifies the given string until a new name is found

func CompleteSpec

func CompleteSpec(ctx context.Context, r *libpod.Runtime, s *specgen.SpecGenerator) ([]string, error)

Fill any missing parts of the spec generator (e.g. from the image). Returns a set of warnings or any fatal error that occurred.

func ConfigToSpec added in v4.1.0

func ConfigToSpec(rt *libpod.Runtime, specg *specgen.SpecGenerator, containerID string) (*libpod.Container, *libpod.InfraInherit, error)

ConfigToSpec takes a completed container config and converts it back into a specgenerator for purposes of cloning an existing container

func DevicesFromPath

func DevicesFromPath(g *generate.Generator, devicePath string) error

DevicesFromPath computes a list of devices

func ExecuteCreate

func ExecuteCreate(ctx context.Context, rt *libpod.Runtime, runtimeSpec *specs.Spec, s *specgen.SpecGenerator, infra bool, options ...libpod.CtrCreateOption) (*libpod.Container, error)

func ExtractCDIDevices

func ExtractCDIDevices(s *specgen.SpecGenerator) []libpod.CtrCreateOption

ExtractCDIDevices process the list of Devices in the spec and determines if any of these are CDI devices. The CDI devices are added to the list of CtrCreateOptions. Note that this may modify the device list associated with the spec, which should then only contain non-CDI devices.

func GenExposedPorts

func GenExposedPorts(exposedPorts map[string]struct{}) (map[uint16]string, error)

func GetDefaultNamespaceMode

func GetDefaultNamespaceMode(nsType string, cfg *config.Config, pod *libpod.Pod) (specgen.Namespace, error)

Get the default namespace mode for any given namespace type.

func GetNamespaceOptions

func GetNamespaceOptions(ns []string, netnsIsHost bool) ([]libpod.PodCreateOption, error)

GetNamespaceOptions transforms a slice of kernel namespaces into a slice of pod create options. Currently, not all kernel namespaces are supported, and they will be returned in an error

func Inherit

func Inherit(infra *libpod.Container, s *specgen.SpecGenerator, rt *libpod.Runtime) (opts []libpod.CtrCreateOption, infraS *specs.Spec, compat *libpod.InfraInherit, err error)

func InitFSMounts

func InitFSMounts(mounts []spec.Mount) error

func IsValidDeviceMode

func IsValidDeviceMode(mode string) bool

IsValidDeviceMode checks if the mode for device is valid or not. IsValid mode is a composition of r (read), w (write), and m (mknod).

func MakeContainer

func MakeContainer(ctx context.Context, rt *libpod.Runtime, s *specgen.SpecGenerator, clone bool, c *libpod.Container) (*specs.Spec, *specgen.SpecGenerator, []libpod.CtrCreateOption, error)

MakeContainer creates a container based on the SpecGenerator. Returns the created, container and any warnings resulting from creating the container, or an error.

func MakePod

func MakePod(p *entities.PodSpec, rt *libpod.Runtime) (_ *libpod.Pod, finalErr error)

func MapSpec

MapSpec modifies the already filled Infra specgenerator, replacing necessary values with those specified in pod creation

func ParseDevice

func ParseDevice(device string) (string, string, string, error)

ParseDevice parses device mapping string to a src, dest & permissions string

func ParsePortMapping

func ParsePortMapping(portMappings []types.PortMapping, exposePorts map[uint16][]string) ([]types.PortMapping, error)

Parse port maps to port mappings. Returns a set of port mappings, and maps of utilized container and host ports.

func PodConfigToSpec added in v4.2.0

func PodConfigToSpec(rt *libpod.Runtime, spec *specgen.PodSpecGenerator, infraOptions *entities.ContainerCreateOptions, id string) (p *libpod.Pod, err error)

func PullOrBuildInfraImage added in v4.2.0

func PullOrBuildInfraImage(rt *libpod.Runtime, imageName string) (string, error)

PullOrBuildInfraImage pulls down the specified image or the one set in containers.conf. If none is set, it builds a local pause image.

func SpecGenToOCI

func SpecGenToOCI(ctx context.Context, s *specgen.SpecGenerator, rt *libpod.Runtime, rtc *config.Config, newImage *libimage.Image, mounts []spec.Mount, pod *libpod.Pod, finalCmd []string, compatibleOptions *libpod.InfraInherit) (*spec.Spec, error)

SpecGenToOCI returns the base configuration for the container.

func SupersedeUserMounts

func SupersedeUserMounts(mounts []spec.Mount, configMount []spec.Mount) []spec.Mount

Supersede existing mounts in the spec with new, user-specified mounts. TODO: Should we unmount subtree mounts? E.g., if /tmp/ is mounted by one mount, and we already have /tmp/a and /tmp/b, should we remove the /tmp/a and /tmp/b mounts in favor of the more general /tmp?

func WeightDevices added in v4.3.0

func WeightDevices(wtDevices map[string]spec.LinuxWeightDevice) ([]spec.LinuxWeightDevice, error)

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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