generate

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Generator

type Generator struct {
	Config *specs.Spec
}

Generator represents a generator for a OCI runtime config.

func New

func New(spec *specs.Spec) *Generator

New returns a generator associated to the OCI specification passed in parameter or an empty OCI specification if parameter is nil.

func (*Generator) AddLinuxGIDMapping

func (g *Generator) AddLinuxGIDMapping(host, container, size uint32)

AddLinuxGIDMapping adds a GID mapping.

func (*Generator) AddLinuxUIDMapping

func (g *Generator) AddLinuxUIDMapping(host, container, size uint32)

AddLinuxUIDMapping adds a UID mapping.

func (*Generator) AddMount

func (g *Generator) AddMount(mnt specs.Mount)

AddMount adds a mount for container environment setup.

func (*Generator) AddOrReplaceLinuxNamespace

func (g *Generator) AddOrReplaceLinuxNamespace(ns specs.LinuxNamespaceType, path string)

AddOrReplaceLinuxNamespace adds or updates a container process namespace.

func (*Generator) AddProcessRlimits

func (g *Generator) AddProcessRlimits(rType string, rHard uint64, rSoft uint64)

AddProcessRlimits adds a container process rlimit.

func (*Generator) RemoveProcessEnv

func (g *Generator) RemoveProcessEnv(env string)

RemoveProcessEnv removes a container process environment variable.

func (*Generator) Save

func (g *Generator) Save(w io.Writer) (err error)

Save writes the configuration into w.

func (*Generator) SaveToFile

func (g *Generator) SaveToFile(path string) error

SaveToFile writes the configuration into a file.

func (*Generator) SetProcessApparmorProfile

func (g *Generator) SetProcessApparmorProfile(prof string)

SetProcessApparmorProfile sets container process AppArmor profile.

func (*Generator) SetProcessArgs

func (g *Generator) SetProcessArgs(args []string)

SetProcessArgs sets container process arguments.

func (*Generator) SetProcessCwd

func (g *Generator) SetProcessCwd(cwd string)

SetProcessCwd sets container process working directory.

func (*Generator) SetProcessEnv added in v1.0.0

func (g *Generator) SetProcessEnv(env, value string)

SetProcessEnv adds or replaces a container process environment variable.

func (*Generator) SetProcessEnvWithPrefixes added in v1.0.0

func (g *Generator) SetProcessEnvWithPrefixes(prefixes []string, variable, value string)

SetProcessEnvWithPrefixes adds or replaces a container process environment variable for each provided prefix. All but the first prefix are deemed deprecated

func (*Generator) SetProcessNoNewPrivileges

func (g *Generator) SetProcessNoNewPrivileges(b bool)

SetProcessNoNewPrivileges sets g.Config.Process.NoNewPrivileges.

func (*Generator) SetProcessSelinuxLabel

func (g *Generator) SetProcessSelinuxLabel(label string)

SetProcessSelinuxLabel sets container process SELinux execution label.

func (*Generator) SetProcessTerminal

func (g *Generator) SetProcessTerminal(b bool)

SetProcessTerminal sets if container process terminal or not.

func (*Generator) SetRootPath

func (g *Generator) SetRootPath(path string)

SetRootPath sets container root filesystem path.

func (*Generator) SetupPrivileged

func (g *Generator) SetupPrivileged(privileged bool)

SetupPrivileged sets requirements for a container process with all privileges.

Jump to

Keyboard shortcuts

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