package opts
import "github.com/containerd/containerd/pkg/cri/opts"
Index ¶
- Constants
- func WithAnnotation(k, v string) oci.SpecOpts
- func WithContainerdShimCgroup(path string) containerd.NewTaskOpts
- func WithNewSnapshot(id string, i containerd.Image, opts ...snapshots.Opt) containerd.NewContainerOpts
- func WithProcessArgs(config *runtime.ContainerConfig, image *imagespec.ImageConfig) oci.SpecOpts
- func WithProcessCommandLineOrArgsForWindows(config *runtime.ContainerConfig, image *imagespec.ImageConfig) oci.SpecOpts
- func WithRelativeRoot(root string) oci.SpecOpts
- func WithVolumes(volumeMounts map[string]string) containerd.NewContainerOpts
- func WithWindowsCredentialSpec(credentialSpec string) oci.SpecOpts
- func WithWindowsDefaultSandboxShares(ctx context.Context, client oci.Client, c *containers.Container, s *runtimespec.Spec) error
- func WithWindowsMounts(osi osinterface.OS, config *runtime.ContainerConfig, extra []*runtime.Mount) oci.SpecOpts
- func WithWindowsNetworkNamespace(path string) oci.SpecOpts
- func WithWindowsResources(resources *runtime.WindowsContainerResources) oci.SpecOpts
- func WithoutRoot(ctx context.Context, client oci.Client, c *containers.Container, s *runtimespec.Spec) error
Constants ¶
const
= 2DefaultSandboxCPUshares is default cpu shares for sandbox container. TODO(windows): Revisit cpu shares for windows (https://github.com/containerd/cri/issues/1297)
Functions ¶
func WithAnnotation ¶
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 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 WithProcessCommandLineOrArgsForWindows ¶
func WithProcessCommandLineOrArgsForWindows(config *runtime.ContainerConfig, image *imagespec.ImageConfig) oci.SpecOpts
WithProcessCommandLineOrArgsForWindows sets the process command line or process args on the spec based on the image and runtime config If image.ArgsEscaped field is set, this function sets the process command line and if not, it sets the process args field
func WithRelativeRoot ¶
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 ¶
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 ¶
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.
Source Files ¶
container.go spec.go spec_windows.go task.go
- Version
- v1.6.25
- Published
- Nov 20, 2023
- Platform
- windows/amd64
- Imports
- 22 packages
- Last checked
- 1 day ago –
Tools for package owners.