generate

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2019 License: Apache-2.0 Imports: 9 Imported by: 3

Documentation

Overview

Package generate implements functions generating container config files.

Index

Constants

This section is empty.

Variables

View Source
var (
	// Namespaces include the names of supported namespaces.
	Namespaces = []string{"network", "pid", "mount", "ipc", "uts", "user", "cgroup"}
)

Functions

This section is empty.

Types

type ExportOptions

type ExportOptions struct {
	Seccomp bool // seccomp toggles if only seccomp should be exported
}

ExportOptions have toggles for exporting only certain parts of the specification

type Generator

type Generator struct {
	Config       *rspec.Spec
	HostSpecific bool
}

Generator represents a generator for a container config.

func New

func New(os string) (generator Generator, err error)

New creates a configuration Generator with the default configuration for the target operating system.

func NewFromFile

func NewFromFile(path string) (Generator, error)

NewFromFile loads the template specified in a file into a configuration Generator.

func NewFromSpec deprecated

func NewFromSpec(config *rspec.Spec) Generator

NewFromSpec creates a configuration Generator from a given configuration.

Deprecated: Replace with:

generator := Generator{Config: config}

func NewFromTemplate

func NewFromTemplate(r io.Reader) (Generator, error)

NewFromTemplate loads the template from io.Reader into a configuration Generator.

func (*Generator) AddAnnotation

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

AddAnnotation adds an annotation into g.Config.Annotations.

func (*Generator) AddDevice

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

AddDevice - add a device into g.Config.Linux.Devices

func (*Generator) AddLinuxGIDMapping

func (g *Generator) AddLinuxGIDMapping(hid, cid, size uint32)

AddLinuxGIDMapping adds gidMap into g.Config.Linux.GIDMappings.

func (*Generator) AddLinuxMaskedPaths

func (g *Generator) AddLinuxMaskedPaths(path string)

AddLinuxMaskedPaths adds masked paths into g.Config.Linux.MaskedPaths.

func (*Generator) AddLinuxReadonlyPaths

func (g *Generator) AddLinuxReadonlyPaths(path string)

AddLinuxReadonlyPaths adds readonly paths into g.Config.Linux.MaskedPaths.

func (*Generator) AddLinuxResourcesBlockIOLeafWeightDevice added in v0.4.0

func (g *Generator) AddLinuxResourcesBlockIOLeafWeightDevice(major int64, minor int64, weight uint16)

AddLinuxResourcesBlockIOLeafWeightDevice adds or sets g.Config.Linux.Resources.BlockIO.WeightDevice.LeafWeight.

func (*Generator) AddLinuxResourcesBlockIOThrottleReadBpsDevice added in v0.4.0

func (g *Generator) AddLinuxResourcesBlockIOThrottleReadBpsDevice(major int64, minor int64, rate uint64)

AddLinuxResourcesBlockIOThrottleReadBpsDevice adds or sets g.Config.Linux.Resources.BlockIO.ThrottleReadBpsDevice.

func (*Generator) AddLinuxResourcesBlockIOThrottleReadIOPSDevice added in v0.4.0

func (g *Generator) AddLinuxResourcesBlockIOThrottleReadIOPSDevice(major int64, minor int64, rate uint64)

AddLinuxResourcesBlockIOThrottleReadIOPSDevice adds or sets g.Config.Linux.Resources.BlockIO.ThrottleReadIOPSDevice.

func (*Generator) AddLinuxResourcesBlockIOThrottleWriteBpsDevice added in v0.4.0

func (g *Generator) AddLinuxResourcesBlockIOThrottleWriteBpsDevice(major int64, minor int64, rate uint64)

AddLinuxResourcesBlockIOThrottleWriteBpsDevice adds or sets g.Config.Linux.Resources.BlockIO.ThrottleWriteBpsDevice.

func (*Generator) AddLinuxResourcesBlockIOThrottleWriteIOPSDevice added in v0.4.0

func (g *Generator) AddLinuxResourcesBlockIOThrottleWriteIOPSDevice(major int64, minor int64, rate uint64)

AddLinuxResourcesBlockIOThrottleWriteIOPSDevice adds or sets g.Config.Linux.Resources.BlockIO.ThrottleWriteIOPSDevice.

func (*Generator) AddLinuxResourcesBlockIOWeightDevice added in v0.4.0

func (g *Generator) AddLinuxResourcesBlockIOWeightDevice(major int64, minor int64, weight uint16)

AddLinuxResourcesBlockIOWeightDevice adds or sets g.Config.Linux.Resources.BlockIO.WeightDevice.Weight.

func (*Generator) AddLinuxResourcesDevice added in v0.3.0

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

AddLinuxResourcesDevice - add a device into g.Config.Linux.Resources.Devices

func (*Generator) AddLinuxResourcesHugepageLimit

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

AddLinuxResourcesHugepageLimit adds or sets g.Config.Linux.Resources.HugepageLimits.

func (*Generator) AddLinuxResourcesNetworkPriorities

func (g *Generator) AddLinuxResourcesNetworkPriorities(name string, prio uint32)

AddLinuxResourcesNetworkPriorities adds or sets g.Config.Linux.Resources.Network.Priorities.

func (*Generator) AddLinuxSysctl

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

AddLinuxSysctl adds a new sysctl config into g.Config.Linux.Sysctl.

func (*Generator) AddLinuxUIDMapping

func (g *Generator) AddLinuxUIDMapping(hid, cid, size uint32)

AddLinuxUIDMapping adds uidMap into g.Config.Linux.UIDMappings.

func (*Generator) AddMount added in v0.4.0

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

AddMount adds a mount into g.Config.Mounts.

func (*Generator) AddOrReplaceLinuxNamespace

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

AddOrReplaceLinuxNamespace adds or replaces a namespace inside g.Config.Linux.Namespaces.

func (*Generator) AddPostStartHook

func (g *Generator) AddPostStartHook(postStartHook rspec.Hook) error

AddPostStartHook adds a poststart hook into g.Config.Hooks.Poststart.

func (*Generator) AddPostStopHook

func (g *Generator) AddPostStopHook(postStopHook rspec.Hook) error

AddPostStopHook adds a poststop hook into g.Config.Hooks.Poststop.

func (*Generator) AddPreStartHook

func (g *Generator) AddPreStartHook(preStartHook rspec.Hook) error

AddPreStartHook add a prestart hook into g.Config.Hooks.Prestart.

func (*Generator) AddProcessAdditionalGid

func (g *Generator) AddProcessAdditionalGid(gid uint32)

AddProcessAdditionalGid adds an additional gid into g.Config.Process.AdditionalGids.

func (*Generator) AddProcessCapability

func (g *Generator) AddProcessCapability(c string) error

AddProcessCapability adds a process capability into all 5 capability sets.

func (*Generator) AddProcessCapabilityAmbient added in v0.2.0

func (g *Generator) AddProcessCapabilityAmbient(c string) error

AddProcessCapabilityAmbient adds a process capability into g.Config.Process.Capabilities.Ambient.

func (*Generator) AddProcessCapabilityBounding added in v0.2.0

func (g *Generator) AddProcessCapabilityBounding(c string) error

AddProcessCapabilityBounding adds a process capability into g.Config.Process.Capabilities.Bounding.

func (*Generator) AddProcessCapabilityEffective added in v0.2.0

func (g *Generator) AddProcessCapabilityEffective(c string) error

AddProcessCapabilityEffective adds a process capability into g.Config.Process.Capabilities.Effective.

func (*Generator) AddProcessCapabilityInheritable added in v0.2.0

func (g *Generator) AddProcessCapabilityInheritable(c string) error

AddProcessCapabilityInheritable adds a process capability into g.Config.Process.Capabilities.Inheritable.

func (*Generator) AddProcessCapabilityPermitted added in v0.2.0

func (g *Generator) AddProcessCapabilityPermitted(c string) error

AddProcessCapabilityPermitted adds a process capability into g.Config.Process.Capabilities.Permitted.

func (*Generator) AddProcessEnv

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

AddProcessEnv adds name=value into g.Config.Process.Env, or replaces an existing entry with the given name.

func (*Generator) AddProcessRlimits

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

AddProcessRlimits adds rlimit into g.Config.Process.Rlimits.

func (*Generator) AddSolarisAnet added in v0.4.0

func (g *Generator) AddSolarisAnet(anet rspec.SolarisAnet)

AddSolarisAnet adds network into g.Config.Solaris.Anet

func (*Generator) AddWindowsDevices added in v0.9.0

func (g *Generator) AddWindowsDevices(id, idType string) error

AddWindowsDevices adds or sets g.Config.Windwos.Devices

func (*Generator) AddWindowsLayerFolders added in v0.4.0

func (g *Generator) AddWindowsLayerFolders(folder string)

AddWindowsLayerFolders adds layer folders into g.Config.Windows.LayerFolders.

func (*Generator) ClearAnnotations

func (g *Generator) ClearAnnotations()

ClearAnnotations clears g.Config.Annotations.

func (*Generator) ClearLinuxDevices

func (g *Generator) ClearLinuxDevices()

ClearLinuxDevices clears g.Config.Linux.Devices

func (*Generator) ClearLinuxGIDMappings

func (g *Generator) ClearLinuxGIDMappings()

ClearLinuxGIDMappings clear g.Config.Linux.GIDMappings.

func (*Generator) ClearLinuxNamespaces

func (g *Generator) ClearLinuxNamespaces()

ClearLinuxNamespaces clear g.Config.Linux.Namespaces.

func (*Generator) ClearLinuxSysctl

func (g *Generator) ClearLinuxSysctl()

ClearLinuxSysctl clears g.Config.Linux.Sysctl.

func (*Generator) ClearLinuxUIDMappings

func (g *Generator) ClearLinuxUIDMappings()

ClearLinuxUIDMappings clear g.Config.Linux.UIDMappings.

func (*Generator) ClearMounts added in v0.4.0

func (g *Generator) ClearMounts()

ClearMounts clear g.Config.Mounts

func (*Generator) ClearPostStartHooks

func (g *Generator) ClearPostStartHooks()

ClearPostStartHooks clear g.Config.Hooks.Poststart.

func (*Generator) ClearPostStopHooks

func (g *Generator) ClearPostStopHooks()

ClearPostStopHooks clear g.Config.Hooks.Poststop.

func (*Generator) ClearPreStartHooks

func (g *Generator) ClearPreStartHooks()

ClearPreStartHooks clear g.Config.Hooks.Prestart.

func (*Generator) ClearProcessAdditionalGids

func (g *Generator) ClearProcessAdditionalGids()

ClearProcessAdditionalGids clear g.Config.Process.AdditionalGids.

func (*Generator) ClearProcessCapabilities

func (g *Generator) ClearProcessCapabilities()

ClearProcessCapabilities clear g.Config.Process.Capabilities.

func (*Generator) ClearProcessEnv

func (g *Generator) ClearProcessEnv()

ClearProcessEnv clears g.Config.Process.Env.

func (*Generator) ClearProcessRlimits

func (g *Generator) ClearProcessRlimits()

ClearProcessRlimits clear g.Config.Process.Rlimits.

func (*Generator) DropLinuxResourcesBlockIOLeafWeightDevice added in v0.4.0

func (g *Generator) DropLinuxResourcesBlockIOLeafWeightDevice(major int64, minor int64)

DropLinuxResourcesBlockIOLeafWeightDevice drops a item form g.Config.Linux.Resources.BlockIO.WeightDevice.LeafWeight

func (*Generator) DropLinuxResourcesBlockIOThrottleReadBpsDevice added in v0.4.0

func (g *Generator) DropLinuxResourcesBlockIOThrottleReadBpsDevice(major int64, minor int64)

DropLinuxResourcesBlockIOThrottleReadBpsDevice drops a item from g.Config.Linux.Resources.BlockIO.ThrottleReadBpsDevice.

func (*Generator) DropLinuxResourcesBlockIOThrottleReadIOPSDevice added in v0.4.0

func (g *Generator) DropLinuxResourcesBlockIOThrottleReadIOPSDevice(major int64, minor int64)

DropLinuxResourcesBlockIOThrottleReadIOPSDevice drops a item from g.Config.Linux.Resources.BlockIO.ThrottleReadIOPSDevice.

func (*Generator) DropLinuxResourcesBlockIOThrottleWriteBpsDevice added in v0.4.0

func (g *Generator) DropLinuxResourcesBlockIOThrottleWriteBpsDevice(major int64, minor int64)

DropLinuxResourcesBlockIOThrottleWriteBpsDevice drops a item from g.Config.Linux.Resources.BlockIO.ThrottleWriteBpsDevice.

func (*Generator) DropLinuxResourcesBlockIOThrottleWriteIOPSDevice added in v0.4.0

func (g *Generator) DropLinuxResourcesBlockIOThrottleWriteIOPSDevice(major int64, minor int64)

DropLinuxResourcesBlockIOThrottleWriteIOPSDevice drops a item from g.Config.Linux.Resources.BlockIO.ThrottleWriteIOPSDevice.

func (*Generator) DropLinuxResourcesBlockIOWeightDevice added in v0.4.0

func (g *Generator) DropLinuxResourcesBlockIOWeightDevice(major int64, minor int64)

DropLinuxResourcesBlockIOWeightDevice drops a item form g.Config.Linux.Resources.BlockIO.WeightDevice.Weight

func (*Generator) DropLinuxResourcesHugepageLimit

func (g *Generator) DropLinuxResourcesHugepageLimit(pageSize string)

DropLinuxResourcesHugepageLimit drops a hugepage limit from g.Config.Linux.Resources.HugepageLimits.

func (*Generator) DropLinuxResourcesNetworkPriorities

func (g *Generator) DropLinuxResourcesNetworkPriorities(name string)

DropLinuxResourcesNetworkPriorities drops one item from g.Config.Linux.Resources.Network.Priorities.

func (*Generator) DropProcessCapability

func (g *Generator) DropProcessCapability(c string) error

DropProcessCapability drops a process capability from all 5 capability sets.

func (*Generator) DropProcessCapabilityAmbient added in v0.2.0

func (g *Generator) DropProcessCapabilityAmbient(c string) error

DropProcessCapabilityAmbient drops a process capability from g.Config.Process.Capabilities.Ambient.

func (*Generator) DropProcessCapabilityBounding added in v0.2.0

func (g *Generator) DropProcessCapabilityBounding(c string) error

DropProcessCapabilityBounding drops a process capability from g.Config.Process.Capabilities.Bounding.

func (*Generator) DropProcessCapabilityEffective added in v0.2.0

func (g *Generator) DropProcessCapabilityEffective(c string) error

DropProcessCapabilityEffective drops a process capability from g.Config.Process.Capabilities.Effective.

func (*Generator) DropProcessCapabilityInheritable added in v0.2.0

func (g *Generator) DropProcessCapabilityInheritable(c string) error

DropProcessCapabilityInheritable drops a process capability from g.Config.Process.Capabilities.Inheritable.

func (*Generator) DropProcessCapabilityPermitted added in v0.2.0

func (g *Generator) DropProcessCapabilityPermitted(c string) error

DropProcessCapabilityPermitted drops a process capability from g.Config.Process.Capabilities.Permitted.

func (*Generator) InitConfigLinuxResourcesCPU added in v0.7.0

func (g *Generator) InitConfigLinuxResourcesCPU()

InitConfigLinuxResourcesCPU initializes CPU of Linux resources

func (*Generator) Mounts added in v0.4.0

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

Mounts returns the list of mounts

func (*Generator) RemoveAllSeccompRules

func (g *Generator) RemoveAllSeccompRules() error

RemoveAllSeccompRules removes all syscall rules

func (*Generator) RemoveAnnotation

func (g *Generator) RemoveAnnotation(key string)

RemoveAnnotation remove an annotation from g.Config.Annotations.

func (*Generator) RemoveDevice

func (g *Generator) RemoveDevice(path string)

RemoveDevice remove a device from g.Config.Linux.Devices

func (*Generator) RemoveHostname added in v0.6.0

func (g *Generator) RemoveHostname()

RemoveHostname removes g.Config.Hostname, setting it to an empty string.

func (*Generator) RemoveLinuxNamespace

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

RemoveLinuxNamespace removes a namespace from g.Config.Linux.Namespaces.

func (*Generator) RemoveLinuxResourcesDevice added in v0.3.0

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

RemoveLinuxResourcesDevice - remove a device from g.Config.Linux.Resources.Devices

func (*Generator) RemoveLinuxSysctl

func (g *Generator) RemoveLinuxSysctl(key string)

RemoveLinuxSysctl removes a sysctl config from g.Config.Linux.Sysctl.

func (*Generator) RemoveMount added in v0.4.0

func (g *Generator) RemoveMount(dest string)

RemoveMount removes a mount point on the dest directory

func (*Generator) RemoveProcessRlimits

func (g *Generator) RemoveProcessRlimits(rType string)

RemoveProcessRlimits removes a rlimit from g.Config.Process.Rlimits.

func (*Generator) RemoveSeccompRule

func (g *Generator) RemoveSeccompRule(arguments string) error

RemoveSeccompRule removes rules for any specified syscalls

func (*Generator) Save

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

Save writes the configuration into w.

func (*Generator) SaveToFile

func (g *Generator) SaveToFile(path string, exportOpts ExportOptions) error

SaveToFile writes the configuration into a file.

func (*Generator) SetDefaultSeccompAction

func (g *Generator) SetDefaultSeccompAction(action string) error

SetDefaultSeccompAction sets the default action for all syscalls not defined and then removes any syscall rules with this action already specified.

func (*Generator) SetDefaultSeccompActionForce

func (g *Generator) SetDefaultSeccompActionForce(action string) error

SetDefaultSeccompActionForce only sets the default action for all syscalls not defined

func (*Generator) SetHostname

func (g *Generator) SetHostname(s string)

SetHostname sets g.Config.Hostname.

func (*Generator) SetLinuxCgroupsPath

func (g *Generator) SetLinuxCgroupsPath(path string)

SetLinuxCgroupsPath sets g.Config.Linux.CgroupsPath.

func (*Generator) SetLinuxIntelRdtL3CacheSchema added in v0.4.0

func (g *Generator) SetLinuxIntelRdtL3CacheSchema(schema string)

SetLinuxIntelRdtL3CacheSchema sets g.Config.Linux.IntelRdt.L3CacheSchema

func (*Generator) SetLinuxMountLabel

func (g *Generator) SetLinuxMountLabel(label string)

SetLinuxMountLabel sets g.Config.Linux.MountLabel.

func (*Generator) SetLinuxResourcesBlockIOLeafWeight added in v0.4.0

func (g *Generator) SetLinuxResourcesBlockIOLeafWeight(weight uint16)

SetLinuxResourcesBlockIOLeafWeight sets g.Config.Linux.Resources.BlockIO.LeafWeight.

func (*Generator) SetLinuxResourcesBlockIOWeight added in v0.4.0

func (g *Generator) SetLinuxResourcesBlockIOWeight(weight uint16)

SetLinuxResourcesBlockIOWeight sets g.Config.Linux.Resources.BlockIO.Weight.

func (*Generator) SetLinuxResourcesCPUCpus

func (g *Generator) SetLinuxResourcesCPUCpus(cpus string)

SetLinuxResourcesCPUCpus sets g.Config.Linux.Resources.CPU.Cpus.

func (*Generator) SetLinuxResourcesCPUMems

func (g *Generator) SetLinuxResourcesCPUMems(mems string)

SetLinuxResourcesCPUMems sets g.Config.Linux.Resources.CPU.Mems.

func (*Generator) SetLinuxResourcesCPUPeriod

func (g *Generator) SetLinuxResourcesCPUPeriod(period uint64)

SetLinuxResourcesCPUPeriod sets g.Config.Linux.Resources.CPU.Period.

func (*Generator) SetLinuxResourcesCPUQuota

func (g *Generator) SetLinuxResourcesCPUQuota(quota int64)

SetLinuxResourcesCPUQuota sets g.Config.Linux.Resources.CPU.Quota.

func (*Generator) SetLinuxResourcesCPURealtimePeriod

func (g *Generator) SetLinuxResourcesCPURealtimePeriod(period uint64)

SetLinuxResourcesCPURealtimePeriod sets g.Config.Linux.Resources.CPU.RealtimePeriod.

func (*Generator) SetLinuxResourcesCPURealtimeRuntime

func (g *Generator) SetLinuxResourcesCPURealtimeRuntime(time int64)

SetLinuxResourcesCPURealtimeRuntime sets g.Config.Linux.Resources.CPU.RealtimeRuntime.

func (*Generator) SetLinuxResourcesCPUShares

func (g *Generator) SetLinuxResourcesCPUShares(shares uint64)

SetLinuxResourcesCPUShares sets g.Config.Linux.Resources.CPU.Shares.

func (*Generator) SetLinuxResourcesMemoryDisableOOMKiller

func (g *Generator) SetLinuxResourcesMemoryDisableOOMKiller(disable bool)

SetLinuxResourcesMemoryDisableOOMKiller sets g.Config.Linux.Resources.Memory.DisableOOMKiller.

func (*Generator) SetLinuxResourcesMemoryKernel

func (g *Generator) SetLinuxResourcesMemoryKernel(kernel int64)

SetLinuxResourcesMemoryKernel sets g.Config.Linux.Resources.Memory.Kernel.

func (*Generator) SetLinuxResourcesMemoryKernelTCP

func (g *Generator) SetLinuxResourcesMemoryKernelTCP(kernelTCP int64)

SetLinuxResourcesMemoryKernelTCP sets g.Config.Linux.Resources.Memory.KernelTCP.

func (*Generator) SetLinuxResourcesMemoryLimit

func (g *Generator) SetLinuxResourcesMemoryLimit(limit int64)

SetLinuxResourcesMemoryLimit sets g.Config.Linux.Resources.Memory.Limit.

func (*Generator) SetLinuxResourcesMemoryReservation

func (g *Generator) SetLinuxResourcesMemoryReservation(reservation int64)

SetLinuxResourcesMemoryReservation sets g.Config.Linux.Resources.Memory.Reservation.

func (*Generator) SetLinuxResourcesMemorySwap

func (g *Generator) SetLinuxResourcesMemorySwap(swap int64)

SetLinuxResourcesMemorySwap sets g.Config.Linux.Resources.Memory.Swap.

func (*Generator) SetLinuxResourcesMemorySwappiness

func (g *Generator) SetLinuxResourcesMemorySwappiness(swappiness uint64)

SetLinuxResourcesMemorySwappiness sets g.Config.Linux.Resources.Memory.Swappiness.

func (*Generator) SetLinuxResourcesNetworkClassID

func (g *Generator) SetLinuxResourcesNetworkClassID(classid uint32)

SetLinuxResourcesNetworkClassID sets g.Config.Linux.Resources.Network.ClassID.

func (*Generator) SetLinuxResourcesPidsLimit

func (g *Generator) SetLinuxResourcesPidsLimit(limit int64)

SetLinuxResourcesPidsLimit sets g.Config.Linux.Resources.Pids.Limit.

func (*Generator) SetLinuxRootPropagation

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

SetLinuxRootPropagation sets g.Config.Linux.RootfsPropagation.

func (*Generator) SetOCIVersion added in v0.9.0

func (g *Generator) SetOCIVersion(s string)

SetOCIVersion sets g.Config.Version.

func (*Generator) SetProcessApparmorProfile

func (g *Generator) SetProcessApparmorProfile(prof string)

SetProcessApparmorProfile sets g.Config.Process.ApparmorProfile.

func (*Generator) SetProcessArgs

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

SetProcessArgs sets g.Config.Process.Args.

func (*Generator) SetProcessConsoleSize

func (g *Generator) SetProcessConsoleSize(width, height uint)

SetProcessConsoleSize sets g.Config.Process.ConsoleSize.

func (*Generator) SetProcessCwd

func (g *Generator) SetProcessCwd(cwd string)

SetProcessCwd sets g.Config.Process.Cwd.

func (*Generator) SetProcessGID

func (g *Generator) SetProcessGID(gid uint32)

SetProcessGID sets g.Config.Process.User.GID.

func (*Generator) SetProcessNoNewPrivileges

func (g *Generator) SetProcessNoNewPrivileges(b bool)

SetProcessNoNewPrivileges sets g.Config.Process.NoNewPrivileges.

func (*Generator) SetProcessOOMScoreAdj

func (g *Generator) SetProcessOOMScoreAdj(adj int)

SetProcessOOMScoreAdj sets g.Config.Process.OOMScoreAdj.

func (*Generator) SetProcessSelinuxLabel

func (g *Generator) SetProcessSelinuxLabel(label string)

SetProcessSelinuxLabel sets g.Config.Process.SelinuxLabel.

func (*Generator) SetProcessTerminal

func (g *Generator) SetProcessTerminal(b bool)

SetProcessTerminal sets g.Config.Process.Terminal.

func (*Generator) SetProcessUID

func (g *Generator) SetProcessUID(uid uint32)

SetProcessUID sets g.Config.Process.User.UID.

func (*Generator) SetProcessUsername added in v0.6.0

func (g *Generator) SetProcessUsername(username string)

SetProcessUsername sets g.Config.Process.User.Username.

func (*Generator) SetRootPath

func (g *Generator) SetRootPath(path string)

SetRootPath sets g.Config.Root.Path.

func (*Generator) SetRootReadonly

func (g *Generator) SetRootReadonly(b bool)

SetRootReadonly sets g.Config.Root.Readonly.

func (*Generator) SetSeccompArchitecture

func (g *Generator) SetSeccompArchitecture(architecture string) error

SetSeccompArchitecture sets the supported seccomp architectures

func (*Generator) SetSolarisCappedCPUNcpus added in v0.4.0

func (g *Generator) SetSolarisCappedCPUNcpus(ncpus string)

SetSolarisCappedCPUNcpus sets g.Config.Solaris.CappedCPU.Ncpus

func (*Generator) SetSolarisCappedMemoryPhysical added in v0.4.0

func (g *Generator) SetSolarisCappedMemoryPhysical(physical string)

SetSolarisCappedMemoryPhysical sets g.Config.Solaris.CappedMemory.Physical

func (*Generator) SetSolarisCappedMemorySwap added in v0.4.0

func (g *Generator) SetSolarisCappedMemorySwap(swap string)

SetSolarisCappedMemorySwap sets g.Config.Solaris.CappedMemory.Swap

func (*Generator) SetSolarisLimitPriv added in v0.4.0

func (g *Generator) SetSolarisLimitPriv(limitPriv string)

SetSolarisLimitPriv sets g.Config.Solaris.LimitPriv

func (*Generator) SetSolarisMaxShmMemory added in v0.4.0

func (g *Generator) SetSolarisMaxShmMemory(memory string)

SetSolarisMaxShmMemory sets g.Config.Solaris.MaxShmMemory

func (*Generator) SetSolarisMilestone added in v0.4.0

func (g *Generator) SetSolarisMilestone(milestone string)

SetSolarisMilestone sets g.Config.Solaris.Milestone

func (*Generator) SetSpec deprecated

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

SetSpec sets the configuration in the Generator g.

Deprecated: Replace with:

Use generator.Config = config

func (*Generator) SetSyscallAction

func (g *Generator) SetSyscallAction(arguments seccomp.SyscallOpts) error

SetSyscallAction adds rules for syscalls with the specified action

func (*Generator) SetVMHypervisorParameters added in v0.9.0

func (g *Generator) SetVMHypervisorParameters(parameters []string)

SetVMHypervisorParameters sets g.Config.VM.Hypervisor.Parameters

func (*Generator) SetVMHypervisorPath added in v0.9.0

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

SetVMHypervisorPath sets g.Config.VM.Hypervisor.Path

func (*Generator) SetVMImageFormat added in v0.9.0

func (g *Generator) SetVMImageFormat(format string) error

SetVMImageFormat sets g.Config.VM.Image.Format

func (*Generator) SetVMImagePath added in v0.9.0

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

SetVMImagePath sets g.Config.VM.Image.Path

func (*Generator) SetVMKernelInitRD added in v0.9.0

func (g *Generator) SetVMKernelInitRD(initrd string) error

SetVMKernelInitRD sets g.Config.VM.Kernel.InitRD

func (*Generator) SetVMKernelParameters added in v0.9.0

func (g *Generator) SetVMKernelParameters(parameters []string)

SetVMKernelParameters sets g.Config.VM.Kernel.Parameters

func (*Generator) SetVMKernelPath added in v0.9.0

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

SetVMKernelPath sets g.Config.VM.Kernel.Path

func (*Generator) SetVersion

func (g *Generator) SetVersion(version string)

SetVersion sets g.Config.Version.

func (*Generator) SetWindowsHypervUntilityVMPath added in v0.4.0

func (g *Generator) SetWindowsHypervUntilityVMPath(path string)

SetWindowsHypervUntilityVMPath sets g.Config.Windows.HyperV.UtilityVMPath.

func (*Generator) SetWindowsIgnoreFlushesDuringBoot added in v0.9.0

func (g *Generator) SetWindowsIgnoreFlushesDuringBoot(ignore bool)

SetWindowsIgnoreFlushesDuringBoot sets g.Config.Windows.IgnoreFlushesDuringBoot.

func (*Generator) SetWindowsNetwork added in v0.4.0

func (g *Generator) SetWindowsNetwork(network rspec.WindowsNetwork)

SetWindowsNetwork sets g.Config.Windows.Network.

func (*Generator) SetWindowsNetworkAllowUnqualifiedDNSQuery added in v0.9.0

func (g *Generator) SetWindowsNetworkAllowUnqualifiedDNSQuery(setting bool)

SetWindowsNetworkAllowUnqualifiedDNSQuery sets g.Config.Windows.Network.AllowUnqualifiedDNSQuery

func (*Generator) SetWindowsNetworkNamespace added in v0.9.0

func (g *Generator) SetWindowsNetworkNamespace(path string)

SetWindowsNetworkNamespace sets g.Config.Windows.Network.NetworkNamespace

func (*Generator) SetWindowsResourcesCPU added in v0.4.0

func (g *Generator) SetWindowsResourcesCPU(cpu rspec.WindowsCPUResources)

SetWindowsResourcesCPU sets g.Config.Windows.Resources.CPU.

func (*Generator) SetWindowsResourcesMemoryLimit added in v0.4.0

func (g *Generator) SetWindowsResourcesMemoryLimit(limit uint64)

SetWindowsResourcesMemoryLimit sets g.Config.Windows.Resources.Memory.Limit.

func (*Generator) SetWindowsResourcesStorage added in v0.4.0

func (g *Generator) SetWindowsResourcesStorage(storage rspec.WindowsStorageResources)

SetWindowsResourcesStorage sets g.Config.Windows.Resources.Storage.

func (*Generator) SetWindowsServicing added in v0.9.0

func (g *Generator) SetWindowsServicing(servicing bool)

SetWindowsServicing sets g.Config.Windows.Servicing.

func (*Generator) SetupPrivileged

func (g *Generator) SetupPrivileged(privileged bool)

SetupPrivileged sets up the privilege-related fields inside g.Config.

func (*Generator) Spec deprecated

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

Spec gets the configuration from the Generator g.

Deprecated: Replace with generator.Config.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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