ocigen

package
v0.12.2 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2026 License: Apache-2.0 Imports: 3 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 {
	// contains filtered or unexported fields
}

Generator implements [generate.UnderlyingGenerator] directly on an *rspec.Spec, removing the need to import github.com/opencontainers/runtime-tools/generate.

func New

func New(spec *rspec.Spec) *Generator

New creates a new Generator for modifying spec.

func (*Generator) AddAnnotation

func (g *Generator) AddAnnotation(key, value string)

AddAnnotation adds or replaces an annotation in the specification.

func (*Generator) AddDevice

func (g *Generator) AddDevice(device rspec.LinuxDevice)

AddDevice adds a Linux device to the specification.

func (*Generator) AddLinuxResourcesDevice

func (g *Generator) AddLinuxResourcesDevice(allow bool, devType string, major, minor *int64, access string)

AddLinuxResourcesDevice adds a Linux device cgroup rule.

func (*Generator) AddLinuxResourcesHugepageLimit

func (g *Generator) AddLinuxResourcesHugepageLimit(pageSize string, limit uint64)

AddLinuxResourcesHugepageLimit adds or replaces a Linux hugepage limit.

func (*Generator) AddLinuxResourcesUnified

func (g *Generator) AddLinuxResourcesUnified(key, val string)

AddLinuxResourcesUnified adds or replaces a unified cgroup resource setting.

func (*Generator) AddLinuxSysctl

func (g *Generator) AddLinuxSysctl(key, value string)

AddLinuxSysctl adds or replaces a Linux sysctl setting.

func (*Generator) AddMount

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

AddMount adds a mount to the specification.

func (*Generator) AddOrReplaceLinuxNamespace

func (g *Generator) AddOrReplaceLinuxNamespace(ns string, path string) error

AddOrReplaceLinuxNamespace adds or replaces a Linux namespace in the specification.

func (*Generator) AddPostStartHook

func (g *Generator) AddPostStartHook(hook rspec.Hook)

AddPostStartHook adds a post-start hook to the specification.

func (*Generator) AddPostStopHook

func (g *Generator) AddPostStopHook(hook rspec.Hook)

AddPostStopHook adds a post-stop hook to the specification.

func (*Generator) AddPreStartHook

func (g *Generator) AddPreStartHook(hook rspec.Hook)

AddPreStartHook adds a pre-start hook to the specification.

func (*Generator) AddProcessEnv

func (g *Generator) AddProcessEnv(name, value string)

AddProcessEnv adds or replaces an environment variable for the process.

func (*Generator) ClearMounts

func (g *Generator) ClearMounts()

ClearMounts removes all mounts from the specification.

func (*Generator) ClearProcessEnv

func (g *Generator) ClearProcessEnv()

ClearProcessEnv removes all environment variables from the process.

func (*Generator) Mounts

func (g *Generator) Mounts() []rspec.Mount

Mounts returns the mounts in the specification.

func (*Generator) RemoveAnnotation

func (g *Generator) RemoveAnnotation(key string)

RemoveAnnotation removes an annotation from the specification.

func (*Generator) RemoveDevice

func (g *Generator) RemoveDevice(path string)

RemoveDevice removes the Linux device with the given path from the specification.

func (*Generator) RemoveLinuxNamespace

func (g *Generator) RemoveLinuxNamespace(ns string) error

RemoveLinuxNamespace removes a Linux namespace from the specification.

func (*Generator) RemoveLinuxSysctl

func (g *Generator) RemoveLinuxSysctl(key string)

RemoveLinuxSysctl removes a Linux sysctl setting.

func (*Generator) RemoveMount

func (g *Generator) RemoveMount(dest string)

RemoveMount removes the mount with the given destination from the specification.

func (*Generator) SetLinuxCgroupsPath

func (g *Generator) SetLinuxCgroupsPath(path string)

SetLinuxCgroupsPath sets the Linux cgroups path.

func (*Generator) SetLinuxResourcesCPUCpus

func (g *Generator) SetLinuxResourcesCPUCpus(cpus string)

SetLinuxResourcesCPUCpus sets the Linux CPUs available to the process.

func (*Generator) SetLinuxResourcesCPUMems

func (g *Generator) SetLinuxResourcesCPUMems(mems string)

SetLinuxResourcesCPUMems sets the Linux memory nodes available to the process.

func (*Generator) SetLinuxResourcesCPUPeriod

func (g *Generator) SetLinuxResourcesCPUPeriod(period uint64)

SetLinuxResourcesCPUPeriod sets the Linux CPU period.

func (*Generator) SetLinuxResourcesCPUQuota

func (g *Generator) SetLinuxResourcesCPUQuota(quota int64)

SetLinuxResourcesCPUQuota sets the Linux CPU quota.

func (*Generator) SetLinuxResourcesCPURealtimePeriod

func (g *Generator) SetLinuxResourcesCPURealtimePeriod(period uint64)

SetLinuxResourcesCPURealtimePeriod sets the Linux CPU realtime period.

func (*Generator) SetLinuxResourcesCPURealtimeRuntime

func (g *Generator) SetLinuxResourcesCPURealtimeRuntime(time int64)

SetLinuxResourcesCPURealtimeRuntime sets the Linux CPU realtime runtime.

func (*Generator) SetLinuxResourcesCPUShares

func (g *Generator) SetLinuxResourcesCPUShares(shares uint64)

SetLinuxResourcesCPUShares sets the Linux CPU shares.

func (*Generator) SetLinuxResourcesMemoryLimit

func (g *Generator) SetLinuxResourcesMemoryLimit(limit int64)

SetLinuxResourcesMemoryLimit sets the Linux memory limit.

func (*Generator) SetLinuxResourcesMemorySwap

func (g *Generator) SetLinuxResourcesMemorySwap(swap int64)

SetLinuxResourcesMemorySwap sets the Linux memory swap limit.

func (*Generator) SetLinuxRootPropagation

func (g *Generator) SetLinuxRootPropagation(rp string) error

SetLinuxRootPropagation sets the Linux root filesystem propagation mode.

func (*Generator) SetProcessArgs

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

SetProcessArgs sets the process arguments.

func (*Generator) SetProcessOOMScoreAdj

func (g *Generator) SetProcessOOMScoreAdj(adj int)

SetProcessOOMScoreAdj sets the process OOM score adjustment.

func (*Generator) Spec

func (g *Generator) Spec() *rspec.Spec

Spec returns the generated OCI runtime specification.

Jump to

Keyboard shortcuts

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