opts

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: May 3, 2021 License: Apache-2.0 Imports: 27 Imported by: 4

Documentation

Index

Constants

View Source
const DefaultSandboxCPUshares = 2

DefaultSandboxCPUshares is default cpu shares for sandbox container. TODO(windows): Revisit cpu shares for windows (https://github.com/containerd/cri/issues/1297)

Variables

This section is empty.

Functions

func WithAnnotation

func WithAnnotation(k, v string) oci.SpecOpts

WithAnnotation sets the provided annotation

func WithContainerdShimCgroup

func WithContainerdShimCgroup(path string) containerd.NewTaskOpts

WithContainerdShimCgroup returns function that sets the containerd shim cgroup path

func WithNewSnapshot

func WithNewSnapshot(id string, i containerd.Image, opts ...snapshots.Opt) containerd.NewContainerOpts

WithNewSnapshot wraps `containerd.WithNewSnapshot` so that if creating the snapshot fails we make sure the image is actually unpacked and and retry.

func WithProcessArgs

func WithProcessArgs(config *runtime.ContainerConfig, image *imagespec.ImageConfig) oci.SpecOpts

WithProcessArgs sets the process args on the spec based on the image and runtime config

func WithRelativeRoot

func WithRelativeRoot(root string) oci.SpecOpts

WithRelativeRoot sets the root for the container

func WithVolumes

func WithVolumes(volumeMounts map[string]string) containerd.NewContainerOpts

WithVolumes copies ownership of volume in rootfs to its corresponding host path. It doesn't update runtime spec. The passed in map is a host path to container path map for all volumes.

func WithWindowsCredentialSpec

func WithWindowsCredentialSpec(credentialSpec string) oci.SpecOpts

WithWindowsCredentialSpec assigns `credentialSpec` to the `runtime.Spec.Windows.CredentialSpec` field.

func WithWindowsDefaultSandboxShares

func WithWindowsDefaultSandboxShares(ctx context.Context, client oci.Client, c *containers.Container, s *runtimespec.Spec) error

WithWindowsDefaultSandboxShares sets the default sandbox CPU shares

func WithWindowsMounts

func WithWindowsMounts(osi osinterface.OS, config *runtime.ContainerConfig, extra []*runtime.Mount) oci.SpecOpts

WithWindowsMounts sorts and adds runtime and CRI mounts to the spec for windows container.

func WithWindowsNetworkNamespace

func WithWindowsNetworkNamespace(path string) oci.SpecOpts

WithWindowsNetworkNamespace sets windows network namespace for container. TODO(windows): Move this into container/containerd.

func WithWindowsResources

func WithWindowsResources(resources *runtime.WindowsContainerResources) oci.SpecOpts

WithWindowsResources sets the provided resource restrictions for windows.

func WithoutRoot

func WithoutRoot(ctx context.Context, client oci.Client, c *containers.Container, s *runtimespec.Spec) error

WithoutRoot sets the root to nil for the container.

Types

This section is empty.

Jump to

Keyboard shortcuts

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