podsandbox

package
v1.7.22 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2024 License: Apache-2.0 Imports: 58 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// MetadataKey is the key used for storing metadata in the sandbox extensions
	MetadataKey = "metadata"
)

Variables

This section is empty.

Functions

func WithNRISandboxDelete

func WithNRISandboxDelete(sandboxID string) containerd.ProcessDeleteOpts

WithNRISandboxDelete calls delete for a sandbox'd task

Types

type CRIService

type CRIService interface {
	EnsureImageExists(ctx context.Context, ref string, config *runtime.PodSandboxConfig) (*imagestore.Image, error)

	// TODO: we should implement Event backoff in Controller.
	BackOffEvent(id string, event interface{})
}

CRIService interface contains things required by controller, but not yet refactored from criService. TODO: this will be removed in subsequent iterations.

type CleanupErr

type CleanupErr struct {
	// contains filtered or unexported fields
}

type Controller

type Controller struct {
	// contains filtered or unexported fields
}

func New

func New(
	config criconfig.Config,
	client *containerd.Client,
	sandboxStore *sandboxstore.Store,
	os osinterface.OS,
	cri CRIService,
	baseOCISpecs map[string]*oci.Spec,
) *Controller

func (*Controller) Create

func (c *Controller) Create(ctx context.Context, _id string, _ ...sandbox.CreateOpt) error

func (*Controller) Platform

func (c *Controller) Platform(_ctx context.Context, _sandboxID string) (imagespec.Platform, error)

func (*Controller) RecoverContainer added in v1.7.2

func (c *Controller) RecoverContainer(ctx context.Context, cntr containerd.Container) (sandboxstore.Sandbox, error)

func (*Controller) Shutdown

func (c *Controller) Shutdown(ctx context.Context, sandboxID string) error

func (*Controller) Start

func (c *Controller) Start(ctx context.Context, id string) (cin sandbox.ControllerInstance, retErr error)

Start creates resources required for the sandbox and starts the sandbox. If an error occurs, Start attempts to tear down the created resources. If an error occurs while tearing down resources, a zero-valued response is returned alongside the error. If the teardown was successful, a nil response is returned with the error. TODO(samuelkarp) Determine whether this error indication is reasonable to retain once controller.Delete is implemented.

func (*Controller) Status

func (c *Controller) Status(ctx context.Context, sandboxID string, verbose bool) (sandbox.ControllerStatus, error)

func (*Controller) Stop

func (c *Controller) Stop(ctx context.Context, sandboxID string, _ ...sandbox.StopOpt) error

func (*Controller) Wait

func (c *Controller) Wait(ctx context.Context, sandboxID string) (sandbox.ExitStatus, error)

type SandboxInfo

type SandboxInfo struct {
	Pid         uint32 `json:"pid"`
	Status      string `json:"processStatus"`
	NetNSClosed bool   `json:"netNamespaceClosed"`
	Image       string `json:"image"`
	SnapshotKey string `json:"snapshotKey"`
	Snapshotter string `json:"snapshotter"`
	// Note: a new field `RuntimeHandler` has been added into the CRI PodSandboxStatus struct, and
	// should be set. This `RuntimeHandler` field will be deprecated after containerd 1.3 (tracked
	// in https://github.com/containerd/cri/issues/1064).
	RuntimeHandler string                    `json:"runtimeHandler"` // see the Note above
	RuntimeType    string                    `json:"runtimeType"`
	RuntimeOptions interface{}               `json:"runtimeOptions"`
	Config         *runtime.PodSandboxConfig `json:"config"`
	// Note: RuntimeSpec may not be populated if the sandbox has not been fully created.
	RuntimeSpec *runtimespec.Spec      `json:"runtimeSpec"`
	CNIResult   *cni.Result            `json:"cniResult"`
	Metadata    *sandboxstore.Metadata `json:"sandboxMetadata"`
}

SandboxInfo is extra information for sandbox. TODO (mikebrow): discuss predefining constants structures for some or all of these field names in CRI

type Status

type Status struct {
	Waiter <-chan containerd.ExitStatus
}

type Store

type Store struct {
	sync.Map
}

func NewStore

func NewStore() *Store

func (*Store) Get

func (s *Store) Get(id string) *Status

func (*Store) Save

func (s *Store) Save(id string, exitCh <-chan containerd.ExitStatus)

Jump to

Keyboard shortcuts

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